﻿(self.webpackChunkvk=self.webpackChunkvk||[]).push([[6970],{371351:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var r=a(667294),n=a(887854),i=a.n(n),s=a(408091),o=a(634777),l=a(379333),c="0 0 24 24",d="chevron_up_24",u=!1;function _(){u||((0,o.addSpriteSymbol)(new(i())({id:d,viewBox:c,content:'<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="chevron_up_24"><path d="M12 10.302l-5.36 4.466a1 1 0 11-1.28-1.536l6-5a1 1 0 011.28 0l6 5a1 1 0 11-1.28 1.536L12 10.302z" fill="currentColor" /></symbol>'})),u=!0)}var g=function(e){return(0,o.useIsomorphicLayoutEffect)((function(){_()}),[]),r.createElement(l.SvgIcon,(0,s.assign)({},e,{viewBox:c,id:d,width:isNaN(e.width)?24:+e.width,height:isNaN(e.height)?24:+e.height}))};g.mountIcon=_;const m=g},527864:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor"><path d="M7 10.75c0-.41.34-.75.75-.75h4.5a.75.75 0 010 1.5h-4.5a.75.75 0 01-.75-.75z"/><path clip-rule="evenodd" d="M14.58 2H5.42c-.53 0-.98 0-1.34.03-.38.03-.74.1-1.08.27-.52.26-.94.68-1.2 1.2-.17.34-.24.7-.27 1.08-.03.36-.03.8-.03 1.34v.42c.02.13.05.3.14.48a1.25 1.25 0 001.02.67L3 7.5v4.98c0 .81 0 1.47.04 2 .05.55.14 1.03.37 1.47.36.7.93 1.28 1.64 1.64.44.23.92.32 1.47.37.53.04 1.19.04 2 .04h2.96c.81 0 1.47 0 2-.04a3.84 3.84 0 001.47-.37c.7-.36 1.28-.93 1.64-1.64.23-.44.32-.92.37-1.47.04-.53.04-1.19.04-2V7.5h.34c.13-.02.3-.05.48-.14a1.25 1.25 0 00.67-1.02l.01-.37v-.05c0-.53 0-.98-.03-1.34-.03-.38-.1-.74-.27-1.08A2.75 2.75 0 0017 2.3a2.8 2.8 0 00-1.08-.27C15.56 2 15.12 2 14.58 2zm.92 5.5h-11v4.95c0 .85 0 1.45.04 1.9.04.46.1.72.2.92.22.42.57.77.99.98.2.1.46.17.91.21.46.04 1.06.04 1.91.04h2.9c.85 0 1.45 0 1.9-.04.46-.04.72-.1.92-.2.42-.22.77-.57.98-.99.1-.2.17-.46.21-.91.04-.46.04-1.06.04-1.91zM17 6v-.05c0-.57 0-.96-.02-1.25a1.36 1.36 0 00-.12-.52 1.25 1.25 0 00-.54-.54c-.1-.05-.23-.1-.52-.12-.3-.02-.68-.02-1.25-.02h-9.1c-.57 0-.96 0-1.25.02-.29.03-.43.07-.52.12-.23.12-.42.3-.54.54-.05.1-.1.23-.12.52C3 5 3 5.38 3 5.95V6z" fill-rule="evenodd"/></g></svg>',name:"archive_outline_20"}}a.d(t,{getIcon20ArchiveOutline:()=>r})},549386:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 18.5a8.5 8.5 0 100-17 8.5 8.5 0 000 17zm4.4-3.05a7 7 0 01-9.84-9.84l9.83 9.84zm1.05-1.06L5.61 4.55a7 7 0 019.84 9.84z" fill="currentColor"/></svg>',name:"block_outline_20"}}a.d(t,{getIcon20BlockOutline:()=>r})},774701:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.7 6.5a.75.75 0 00-.7.8l.5 7a.75.75 0 001.5-.1l-.5-7a.75.75 0 00-.8-.7zm4.6 0a.75.75 0 01.7.8l-.5 7a.75.75 0 01-1.5-.1l.5-7a.75.75 0 01.8-.7z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 3a.75.75 0 000 1.5h1.07l.95 10.44c.05.49.09.9.14 1.23.06.35.15.68.33.98.28.47.7.85 1.19 1.08.32.16.65.22 1 .24.34.03.76.03 1.25.03h3.64c.5 0 .9 0 1.24-.03a2.8 2.8 0 001.01-.24 2.75 2.75 0 001.19-1.08c.18-.3.27-.63.33-.98.05-.33.1-.74.14-1.23l.96-10.44h1.06a.75.75 0 000-1.5h-4.59a3.25 3.25 0 00-6.32 0H2.25zm3.52 11.77c.04.53.08.88.12 1.15.05.26.1.38.15.47.12.21.3.38.53.49.1.04.22.08.48.1.28.02.63.02 1.16.02h3.58c.53 0 .88 0 1.16-.02.26-.02.39-.06.48-.1a1.25 1.25 0 00.53-.5c.05-.08.1-.2.15-.46.04-.27.08-.62.12-1.15l.95-10.27H4.82l.95 10.27zM10 2c-.7 0-1.3.4-1.58 1h3.16A1.75 1.75 0 0010 2z" fill="currentColor"/></svg>',name:"delete_outline_20"}}a.d(t,{getIcon20DeleteOutline:()=>r})},537741:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 10c0-3.21 2.87-6 6.75-6 .42 0 .8-.3.8-.75.01-.44-.38-.75-.8-.75C5.68 2.5 2 5.83 2 10a7 7 0 001.26 4c-.1.6-.47 1.52-1.12 2.73a1.2 1.2 0 001.1 1.77c1.9-.06 3.35-.51 4.35-1.4.85.27 1.74.4 2.66.4 4.57 0 8.25-3.33 8.25-7.5 0-.36-.03-.72-.08-1.07a.75.75 0 00-1.49.23c.05.28.07.56.07.84 0 3.21-2.87 6-6.75 6a7.58 7.58 0 01-2.22-.33l-.4-.12a.75.75 0 00-.72.15l-.31.28c-.57.5-1.48.88-2.9 1 .53-1.05.9-1.98 1.04-2.71l.05-.3a.75.75 0 00-.12-.57l-.17-.25a5.51 5.51 0 01-1-3.15z" fill="currentColor"/><path d="M17 5.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" fill="currentColor"/></svg>',name:"message_unread_top_outline_20"}}a.d(t,{getIcon20MessageUnreadTopOutline:()=>r})},129175:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M4.89 3.55c.29-.29.76-.29 1.06 0L16.1 13.72a.75.75 0 01-1.06 1.06L13 12.73v2.53c0 .83-.7 1.4-1.46 1.4-.63 0-1.25-.23-1.72-.66L6.3 12.72h-1.5c-.94 0-1.79-.71-1.79-1.7V8.98c0-1 .85-1.71 1.78-1.71h1.5l.66-.6L4.9 4.6a.75.75 0 010-1.06zM8 7.74l-.92.84a.75.75 0 01-.5.2h-1.8c-.1 0-.18.03-.23.08a.17.17 0 00-.06.13V11c0 .04.02.09.06.13.05.05.13.08.22.08h1.8c.2 0 .37.07.51.2l3.75 3.48c.17.16.4.26.66.27v-3.94zm3.53-4.4c.75 0 1.46.57 1.46 1.4v1.94a.75.75 0 01-1.5 0V4.83c-.26.01-.49.11-.66.27l-.1.1A.75.75 0 019.7 4.1l.11-.1a2.53 2.53 0 011.72-.67z" fill="currentColor"/></svg>',name:"mute_outline_20"}}a.d(t,{getIcon20MuteOutline:()=>r})},700521:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M5.5 8a4.5 4.5 0 019 0v1.67c0 .3.1.58.3.8l1.52 1.8a.75.75 0 01-.57 1.23H4.25a.75.75 0 01-.57-1.24l1.52-1.78c.2-.23.3-.52.3-.81V8zm-1.49-.39A6 6 0 0116 7.75v1.82l1.46 1.72c1.25 1.46.21 3.71-1.7 3.71h-2.08a3.75 3.75 0 01-7.35 0H4.25a2.25 2.25 0 01-1.71-3.7L4 9.56V7.75l.01-.14zM10 16.5c-.98 0-1.81-.63-2.12-1.5h4.24c-.3.87-1.14 1.5-2.12 1.5z" fill="currentColor" fill-rule="evenodd"/></svg>',name:"notification_outline_20"}}a.d(t,{getIcon20NotificationOutline:()=>r})},491372:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g id="pin_outline_20__Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="pin_outline_20__Icons-20/pin_outline_20"><g id="pin_outline_20__pin_outline_20"><path d="M0 0h20v20H0z"/><path d="M11.33 2.6a.75.75 0 011.27-.38l5.18 5.18a.75.75 0 01-.38 1.27l-1.54.3a.3.3 0 00-.15.09l-2.47 2.46a.3.3 0 00-.08.19l-.3 3.86a1.01 1.01 0 01-1.72.63L8 13.07l-4.72 4.71a.75.75 0 01-1.13-.98l.07-.08L6.93 12 3.8 8.87c-.37-.37-.4-.94-.09-1.34l.09-.1c.17-.17.4-.27.63-.29l3.86-.3a.3.3 0 00.19-.08l2.46-2.46a.3.3 0 00.08-.16zm1.2 1.67l-.03.17a1.8 1.8 0 01-.5.92L9.54 7.82c-.3.3-.7.49-1.13.52l-2.8.22 5.83 5.83.22-2.8c.03-.37.17-.73.41-1.01l.11-.12L14.64 8c.26-.25.58-.42.92-.5l.17-.03-3.2-3.2z" id="pin_outline_20__Icon-Color" fill="currentColor" fill-rule="nonzero"/></g></g></g></svg>',name:"pin_outline_20"}}a.d(t,{getIcon20PinOutline:()=>r})},467233:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill="currentColor" fill-rule="evenodd"><path d="M17.96 8.15a.75.75 0 01-.57.52l-1.56.31a.25.25 0 00-.14.08c-.22.24-.45.47-.69.7a.75.75 0 01-1.06-1.06l.65-.66c.25-.27.58-.45.94-.53l.2-.04-3.2-3.2-.04.19c-.07.34-.23.65-.48.9l-.7.7A.75.75 0 0110.23 5l.7-.7a.25.25 0 00.08-.13l.3-1.56a.75.75 0 011.27-.39l5.19 5.18c.2.2.26.49.18.75zM8 13.06l3.14 3.14c.6.61 1.61.23 1.71-.58.09-.84.13-1.68.2-2.51l1.67 1.67a.75.75 0 101.06-1.06l-9.5-9.5a.75.75 0 10-1.06 1.06l1.67 1.67c-.85.07-1.72.08-2.56.2a1.01 1.01 0 00-.53 1.72L6.94 12l-4.8 4.8a.75.75 0 001.14.98zm3.44 1.33l.21-2.68-3.37-3.37-2.67.22z"/></g></svg>',name:"pin_slash_outline_20"}}a.d(t,{getIcon20PinSlashOutline:()=>r})},743620:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g fill="currentColor"><path d="M10.75 11.56l.97.97a.75.75 0 101.06-1.06l-2.25-2.25a.75.75 0 00-1.06 0l-2.25 2.25a.75.75 0 101.06 1.06l.97-.97v2.69a.75.75 0 001.5 0z"/><path clip-rule="evenodd" d="M14.58 2H5.42c-.53 0-.98 0-1.34.03-.38.03-.74.1-1.08.27-.52.26-.94.68-1.2 1.2-.17.34-.24.7-.27 1.08-.03.36-.03.8-.03 1.34v.42c.02.13.05.3.14.48a1.25 1.25 0 001.02.67L3 7.5v4.98c0 .81 0 1.47.04 2 .05.55.14 1.03.37 1.47.36.7.93 1.28 1.64 1.64.44.23.92.32 1.47.37.53.04 1.19.04 2 .04h2.96c.81 0 1.47 0 2-.04a3.84 3.84 0 001.47-.37c.7-.36 1.28-.93 1.64-1.64.23-.44.32-.92.37-1.47.04-.53.04-1.19.04-2V7.5h.34c.13-.02.3-.05.48-.14a1.25 1.25 0 00.67-1.02l.01-.37v-.05c0-.53 0-.98-.03-1.34-.03-.38-.1-.74-.27-1.08A2.75 2.75 0 0017 2.3a2.8 2.8 0 00-1.08-.27C15.56 2 15.12 2 14.58 2zm.92 5.5h-11v4.95c0 .85 0 1.45.04 1.9.04.46.1.72.2.92.22.42.57.77.99.98.2.1.46.17.91.21.46.04 1.06.04 1.91.04h2.9c.85 0 1.45 0 1.9-.04.46-.04.72-.1.92-.2.42-.22.77-.57.98-.99.1-.2.17-.46.21-.91.04-.46.04-1.06.04-1.91zM17 6v-.05c0-.57 0-.96-.02-1.25a1.36 1.36 0 00-.12-.52 1.25 1.25 0 00-.54-.54c-.1-.05-.23-.1-.52-.12-.3-.02-.68-.02-1.25-.02h-9.1c-.57 0-.96 0-1.25.02-.29.03-.43.07-.52.12-.23.12-.42.3-.54.54-.05.1-.1.23-.12.52C3 5 3 5.38 3 5.95V6z" fill-rule="evenodd"/></g></svg>',name:"unarchive_outline_20"}}a.d(t,{getIcon20UnarchiveOutline:()=>r})},336322:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M11.54 3.33c.75 0 1.46.58 1.46 1.41v10.52c0 .83-.7 1.4-1.46 1.4-.63 0-1.25-.23-1.72-.66L6.3 12.72h-1.5c-.94 0-1.79-.71-1.79-1.7V8.98c0-1 .85-1.71 1.78-1.71h1.5L9.83 4a2.53 2.53 0 011.72-.67zm-.04 1.5c-.26.01-.49.11-.66.27L7.1 8.58a.75.75 0 01-.5.2h-1.8c-.12 0-.29.07-.29.2v2.03c0 .14.17.21.28.21h1.8c.2 0 .37.07.51.2l3.75 3.48c.17.16.4.26.66.27zm6.12.4A6.76 6.76 0 0119.67 10c0 1.84-.79 3.5-2.05 4.78a.75.75 0 11-1.07-1.06A5.26 5.26 0 0018.17 10c0-1.4-.6-2.7-1.62-3.72a.75.75 0 111.07-1.06zm-2.13 2.54c.52.61.84 1.38.84 2.23 0 .85-.32 1.62-.84 2.23a.75.75 0 01-1.15-.96c.32-.38.5-.82.5-1.27 0-.45-.18-.89-.5-1.27a.75.75 0 011.15-.96z" fill="currentColor"/></svg>',name:"volume_outline_20"}}a.d(t,{getIcon20VolumeOutline:()=>r})},49031:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g id="work_outline_20__Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="work_outline_20__Icons-20/work_outline_20"><g id="work_outline_20__work_outline_20"><path opacity=".4" d="M0 0h20v20H0z"/><path d="M10.8 2c1.11 0 1.51.12 1.92.33.4.22.73.54.95.95.2.38.31.76.33 1.71v.51h1.36c1.04 0 1.45.12 1.86.33.4.22.73.54.95.95.21.4.33.82.33 1.86v1.8c0 .89-.1 1.21-.27 1.54-.17.31-.41.57-.73.74v1.53a3.25 3.25 0 01-3.07 3.24l-.18.01h-8.5a3.25 3.25 0 01-3.24-3.07l-.01-.18v-1.53l-.13-.08c-.26-.17-.46-.4-.6-.66-.16-.3-.26-.6-.27-1.35v-2c0-1.03.12-1.44.33-1.85.22-.4.54-.73.95-.95.38-.2.76-.31 1.64-.33H6v-.3c0-1.11.12-1.51.33-1.92.22-.4.54-.73.95-.95.38-.2.76-.31 1.71-.33h1.8zM16 13H4v1.25c0 .92.7 1.67 1.6 1.74l.15.01h8.5c.92 0 1.67-.7 1.74-1.6l.01-.15V13zm-.47-6H4.47l-.31.01c-.36.02-.52.06-.67.15a.77.77 0 00-.33.33c-.1.2-.15.39-.16.98V10.82c.01.2.03.3.06.38l.03.07c.03.06.08.1.14.14l.07.03c.11.04.28.06.76.06h11.88c.48 0 .65-.02.76-.06l.07-.03c.06-.03.1-.08.14-.14l.03-.07c.04-.11.06-.28.06-.76v-1.8c0-.72-.04-.94-.16-1.15a.77.77 0 00-.33-.33c-.2-.1-.39-.15-.98-.16zm-4.56-3.5H8.72c-.33.02-.5.05-.63.1l-.1.06a.77.77 0 00-.33.33l-.05.1c-.07.17-.1.4-.1.94l-.01.47h5v-.78a1.82 1.82 0 00-.1-.63l-.06-.1a.77.77 0 00-.33-.33l-.1-.05a2.6 2.6 0 00-.94-.1z" id="work_outline_20__Icon-Color" fill="currentColor" fill-rule="nonzero"/></g></g></g></svg>',name:"work_outline_20"}}a.d(t,{getIcon20WorkOutline:()=>r})},854778:(e,t,a)=>{"use strict";function r(){return{icon:'<svg fill="none" height="24" width="24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M11.18 3.9h1.64c1.1 0 1.8 0 2.35.05.52.04.73.11.84.17a2 2 0 01.87.87c.06.11.13.32.17.84.05.54.05 1.26.05 2.35v7.64c0 1.1 0 1.8-.05 2.35-.04.52-.11.73-.17.84a2 2 0 01-.87.87c-.11.06-.32.13-.84.17-.54.05-1.26.05-2.35.05h-1.64c-1.1 0-1.8 0-2.35-.05a2.26 2.26 0 01-.84-.17 2 2 0 01-.87-.87 2.24 2.24 0 01-.17-.84c-.05-.54-.05-1.26-.05-2.35V8.18c0-1.1 0-1.8.05-2.35.04-.52.11-.73.17-.84a2 2 0 01.87-.87c.11-.06.32-.13.84-.17.54-.05 1.26-.05 2.35-.05zM5.1 8.18c0-2.13 0-3.2.41-4a3.8 3.8 0 011.66-1.66C8 2.1 9.05 2.1 11.18 2.1h1.64c2.13 0 3.2 0 4 .41a3.8 3.8 0 011.66 1.66c.42.82.42 1.88.42 4.01v7.64c0 2.13 0 3.2-.41 4a3.8 3.8 0 01-1.66 1.66c-.82.42-1.88.42-4.01.42h-1.64c-2.13 0-3.2 0-4-.41a3.8 3.8 0 01-1.67-1.66c-.41-.82-.41-1.88-.41-4.01zm6.15 8.02a.9.9 0 100 1.8h1.5a.9.9 0 000-1.8z" fill="currentColor" fill-rule="evenodd"/></svg>',name:"smartphone_outline_24"}}a.d(t,{getIcon24SmartphoneOutline:()=>r})},550220:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="user_outline_24__Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="user_outline_24__user_outline_24"><path id="user_outline_24__Bounds" d="M0 0h24v24H0z"/><path d="M14.85 7.95a2.85 2.85 0 10-5.7 0 2.85 2.85 0 005.7 0zm1.8 0a4.65 4.65 0 11-9.3 0 4.65 4.65 0 019.3 0zM5.9 18.43c0 .77-.1.67.34.67h11.52c.43 0 .34.1.34-.67 0-1.9-2.78-3.03-6.1-3.03s-6.1 1.14-6.1 3.03zm-1.8 0c0-3.33 3.67-4.83 7.9-4.83s7.9 1.5 7.9 4.83c0 1.73-.69 2.47-2.14 2.47H6.24c-1.45 0-2.14-.74-2.14-2.47z" id="user_outline_24__Mask" fill="currentColor" fill-rule="nonzero"/></g></g></svg>',name:"user_outline_24"}}a.d(t,{getIcon24UserOutline:()=>r})},58042:(e,t,a)=>{"use strict";function r(){return{icon:'<svg width="56" height="56" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M22.03 10c-8.48 0-14.97 5.92-14.97 12.8 0 2.47.82 4.79 2.25 6.74a1.5 1.5 0 01.3.9c0 1.63-.43 3.22-.96 4.67a41.9 41.9 0 01-1.17 2.8c3.31-.33 5.5-1.4 6.8-2.96a1.5 1.5 0 011.69-.43 17.06 17.06 0 006.06 1.1C30.5 35.61 37 29.68 37 22.8 37 15.93 30.5 10 22.03 10zM4.06 22.8C4.06 13.9 12.3 7 22.03 7 31.75 7 40 13.88 40 22.8c0 8.93-8.25 15.81-17.97 15.81-2.17 0-4.25-.33-6.17-.95-2.26 2.14-5.55 3.18-9.6 3.34a2.2 2.2 0 01-2.07-3.08l.42-.95c.43-.96.86-1.9 1.22-2.9.41-1.11.69-2.18.76-3.18a14.28 14.28 0 01-2.53-8.08z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M43.01 18.77a1.5 1.5 0 00.38 2.09c3.44 2.38 5.55 5.98 5.55 9.95 0 2.47-.81 4.78-2.25 6.73a1.5 1.5 0 00-.3.9c0 1.63.43 3.22.96 4.67.35.96.77 1.92 1.17 2.8-3.31-.33-5.5-1.4-6.8-2.96a1.5 1.5 0 00-1.69-.43 17.06 17.06 0 01-6.06 1.1c-2.98 0-5.75-.76-8.08-2.03a1.5 1.5 0 00-1.44 2.63 20.19 20.19 0 0015.7 1.44c2.25 2.14 5.54 3.18 9.59 3.34a2.2 2.2 0 002.07-3.08l-.42-.95c-.44-.96-.86-1.9-1.22-2.9a11.65 11.65 0 01-.76-3.18 14.28 14.28 0 002.53-8.08c0-5.1-2.72-9.56-6.84-12.42a1.5 1.5 0 00-2.09.38z" fill="currentColor"/></svg>',name:"messages_outline_56"}}a.d(t,{getIcon56MessagesOutline:()=>r})},10352:(e,t,a)=>{"use strict";a.d(t,{ONLINE_SEEN_RECENTLY:()=>r,ONLINE_SEEN_LAST_WEEK:()=>n,ONLINE_SEEN_LAST_MONTH:()=>i,ONLINE_SEEN_LONG_AGO:()=>s});var r="recently",n="last_week",i="last_month",s="long_ago"},251976:(e,t,a)=>{"use strict";a.d(t,{PINNED_CONVERSATION_BIT_MASK:()=>r,MASS_MENTION_ALIASES:()=>n,MASS_MENTION_REGEXP:()=>i,VK_OFFICIAL_PEER_ID:()=>s});a(283946);var r=112,n={all:["all","everyone","все"],online:["online","here","здесь","тут"]},i=new RegExp(['(?!,|;|:|\\.|\\s|<br ?/?>|"|\\(|\\)|\\[|\\]|!|\\?)',"(",[].concat(n.all).concat(n.online).map((e=>`@${e}|\\*${e}`)).join("|"),")",'(?=$|,|;|:|\\.(?![a-z0-9_-])|\\s|<br ?/?>|"|\\(|\\)|\\[|\\]|!|\\?)'].join(""),"gi"),s=-22822305},884137:(e,t,a)=>{"use strict";a.d(t,{wrapAwayIfExternal:()=>i});a(283946);var r=a(961540),n=new RegExp(`^(https?:\\/\\/)?([a-z0-9_\\-.]+\\.)?${r.VK_SITE_REGEX_SOURCE_UNSAFE}(\\/.*)?`);function i(e,t){var a=decodeURIComponent(e);return/^\/[^/]/.test(a)||n.test(a)?e:"/away.php?to="+encodeURIComponent(a)+(t?"&utf=1":"")}},33649:(e,t,a)=>{"use strict";a.d(t,{getLastSeenByStatus:()=>n});var r=a(10352);function n(e,t){var a;switch(e){case r.ONLINE_SEEN_RECENTLY:a=getLang("global_online_was_recently","raw");break;case r.ONLINE_SEEN_LAST_WEEK:a=getLang("global_online_was_week","raw");break;case r.ONLINE_SEEN_LAST_MONTH:a=getLang("global_online_this_month","raw");break;case r.ONLINE_SEEN_LONG_AGO:a=getLang("global_online_long_ago","raw");break;default:return""}return langSex(t,a)}},454593:(e,t,a)=>{"use strict";a.d(t,{CONTROLLER:()=>y.CONTROLLER,loadHashes:()=>I.loadHashes,addNewMember:()=>A.addNewMember,searchHints:()=>k.searchHints,updateBlockStates:()=>N.updateBlockStates,mergeTabs:()=>P.mergeTabs,localIndexToDialog:()=>O.getConvoInfoFromLocalIndex,filterFromTab:()=>O.getFilterFnForConvoListFolder,setActions:()=>P.setActions,ACTIVITY_PERIOD:()=>Q,ACTIVITY_TYPE_TYPING:()=>J,ACTIVITY_TYPE_RECORDING_AUDIO:()=>X,ACTION_PRIORITIES:()=>re,strHistory:()=>ne,setCallAvailability:()=>ie,removeFailed:()=>se,removeExpiredFailed:()=>oe,selectPeer:()=>ce,selectPeerOnMessage:()=>ue,changePeer:()=>_e,updateMentions:()=>me,loadMoreHistory:()=>pe,loadLessHistory:()=>he,readLastMessages:()=>ve,readTillSpecificMessage:()=>be,loadLongPollKey:()=>Ce,loadLongPollTs:()=>Ee,setMessageErrored:()=>ye,resendMessage:()=>Te,addDialog:()=>Le,updateVideoThumb:()=>Se,editMessage:()=>ke,addMessage:()=>Me,markInboundMessagesAsRead:()=>we,markOutboundMessagesAsRead:()=>Pe,initTextStore:()=>Oe,processFwd:()=>Re,updateOnline:()=>De,setActivity:()=>Fe,updateActivity:()=>xe,waitActivity:()=>He,sendMessage:()=>Be,deliverMessage:()=>Ge,deliverEditedMessage:()=>je,addSelection:()=>qe,cleanSelected:()=>Ve,replaceMessage:()=>ze,loadMedia:()=>Ye,addCarouselTemplateToStore:()=>$e,addAttachmentsToStoreData:()=>Ke,setCurrentSearchDate:()=>We,setInplaceSearch:()=>Qe,setCurrentSearch:()=>Je,searchHintsIndex:()=>Xe,searchTopConv:()=>et,searchImTopConv:()=>tt,searchLocalHints:()=>at,preloadSearchIndex:()=>rt,loadDialogs:()=>nt,searchMessages:()=>it,isSearchAllLoaded:()=>st,isSearchingInplace:()=>ot,cancelSearch:()=>lt,clearDate:()=>ct,searchMessagesInplace:()=>ut,loadImportant:()=>_t,loadActualLastMessage:()=>gt,removeMessagesMarkDeleted:()=>mt,removeMessages:()=>pt,removeMessageSend:()=>ht,removeMessagesWithRestore:()=>ft,restoreMessage:()=>vt,restoreMessageSend:()=>bt,acceptMessageRequest:()=>Et,rejectMessageRequest:()=>yt,sendTyping:()=>Tt,sendRecordingAudio:()=>It,forwardMessages:()=>At,prepareForward:()=>Lt,deletedDialog:()=>St,flushHistory:()=>kt,updateChatTopic:()=>Mt,loadChatInfo:()=>Nt,loadChatMember:()=>wt,checkNewPeople:()=>Pt,loadNewPeople:()=>Ot,updateChatPhoto:()=>Rt,leaveChat:()=>Ft,returnToChat:()=>xt,toggleMutePeer:()=>Ht,toggleMuteMentionsPeer:()=>Ut,setMutedPeer:()=>Bt,setExecStack:()=>Gt,favMessage:()=>jt,updateFavMessage:()=>qt,updateImportant:()=>Vt,loadSpam:()=>zt,flushSpam:()=>Yt,setCreationType:()=>$t,getOwnerPhoto:()=>Kt,getContactsList:()=>Wt,presetAvatar:()=>Qt,resync:()=>Jt,toggleSendingAbility:()=>Xt,setDelayedMessage:()=>Zt,isAnythingLoading:()=>ea,updateFavAndTitle:()=>ta,saveHistoryScroll:()=>aa,changeDialogsTab:()=>ra,shouldIncludeDialog:()=>na,updateFolderState:()=>ia,toggleDialogImportant:()=>sa,markDialogAnswered:()=>oa,markDialogUnread:()=>la,markDialogRead:()=>ca,getMutexQueue:()=>da,releaseBlock:()=>ua,toggleCommunityMute:()=>_a,deleteDialog:()=>ga,restoreDialog:()=>ma,spamDialog:()=>pa,updateTabbedPeers:()=>ha,isEverythingLoaded:()=>fa,cleanTab:()=>va,stringifyTab:()=>ba,updateGoToEndVisibility:()=>Ca,updateGoToMentionVisibility:()=>Ea,toggleCommunityMessages:()=>ya,syncHistory:()=>Ta,cancelRecording:()=>Ia,setVoiceMessageAvail:()=>Aa,toggleConversation:()=>La,updateSearchQuery:()=>Sa,initializeChatResize:()=>ka,joinChat:()=>Ma,getInviteLink:()=>Na,resetInviteLink:()=>wa,leaveInvitation:()=>Pa,saveRecentSearchPeer:()=>Oa,resetRecentSearch:()=>Ra,removeFromRecentSearch:()=>Da,pinMessageOptimistic:()=>Fa,unpinMessageOptimistic:()=>xa,pinMessage:()=>Ha,unpinMessage:()=>Ua,getPinnedMessage:()=>Ba,getMessageLocalId:()=>Ga,getChatDetails:()=>ja,updateFlags:()=>qa,removeChatPhoto:()=>Va,toggleAdminOptimisticly:()=>za,toggleAdmin:()=>Ya,checkChatMember:()=>$a,hidePromoTooltip:()=>Ka,hideTopBannerAction:()=>Wa,callbackTopBannerAction:()=>Qa,loadBanner:()=>Ja,setKeyboard:()=>Xa,deleteKeyboard:()=>Za,toggleKeyboard:()=>er,loadKeyboard:()=>tr,changeCommunityAccess:()=>ar,deleteTemplate:()=>rr,createTemplate:()=>nr,updateTemplate:()=>ir,resetTabAll:()=>sr,updateMessageRequestsCounter:()=>or,updateCasperMessageExpiringStatus:()=>lr,prepareCasperMessagesFromMessages:()=>cr,peerProfileToggleTag:()=>dr,peerProfileManageTags:()=>ur,peerProfileSaveNote:()=>_r,reloadMessage:()=>gr,getPeerActiveCallData:()=>mr,removePeerActiveCallData:()=>pr,updatePeerTagsFilter:()=>hr,updatePeerTags:()=>fr,updatePeerTagsFilterFolder:()=>vr,updatePeerProfileTags:()=>br});a(530522),a(579665),a(95767),a(796409),a(66108),a(976142),a(175115),a(176774),a(820075),a(991181),a(940851),a(296253);var r=a(887294),n=a(283303),i=a(663825),s=a(191040),o=a(826338),l=a(982452),c=a(28238),d=a(597903),u=a(254692),_=a(251976),g=a(104837),m=a(294940),p=a(549892),h=a(145072),f=a(376473),v=a(412947),b=a(315544),C=a(712439),E=a(582744),y=a(179288),T=a(653736),I=a(121074),A=a(179203),L=a(645523),S=a(375053),k=a(917791),M=a(459554),N=a(475234),w=a(499349),P=a(407381),O=a(923876),R=a(826542),D=a(18149),F=a(993421),x=a(352111),H=a(533304),U=a(588870),B=a(827749),G=a(19331),j=a(419672),q=a(578843),V=a(820696);function z(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=K(e))){var t=0,a=function(){};return{s:a,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,n,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,n=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw n}}}}function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Y.apply(this,arguments)}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){if(e){if("string"==typeof e)return W(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?W(e,t):void 0}}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var Q=5,J="typing",X="audiomessage",Z=(0,n.updateLazyLocation)(),ee=Z.scheduleNav,te=Z.commitNav,ae=Z.scheduleNavWithTimeOut,re={[y.ConvoAction.SEARCH]:0,[y.ConvoAction.MEDIA]:1,[y.ConvoAction.CHAT_INVITE]:2,[y.ConvoAction.USER_INVITE]:2,[y.ConvoAction.CREATE_CHAT]:2,[y.ConvoAction.ADD_FRIEND]:3,[y.ConvoAction.SETTINGS]:3,[y.ConvoAction.PIN_HIDE]:10,[y.ConvoAction.PIN_UNHIDE]:10,[y.ConvoAction.UNPIN]:11,[y.ConvoAction.UNREAD]:20,[y.ConvoAction.MUTE]:21,[y.ConvoAction.UNMUTE]:21,[y.ConvoAction.PIN_CONVO]:22,[y.ConvoAction.UNPIN_CONVO]:22,[y.ConvoAction.ARCHIVE]:30,[y.ConvoAction.UNARCHIVE]:30,[y.ConvoAction.CLEAR]:31,[y.ConvoAction.ENABLE_BUSINESS_NOTIFY]:32,[y.ConvoAction.DISABLE_BUSINESS_NOTIFY]:32,[y.ConvoAction.BLOCK]:32,[y.ConvoAction.BLOCK_COMMUNITY]:33,[y.ConvoAction.ALLOW_COMMUNITY]:33,[y.ConvoAction.BLOCK_NOTIFY]:34,[y.ConvoAction.LEAVE]:35,[y.ConvoAction.RETURN]:35};function ne(e){return"string"==typeof e?e:e.innerHTML}function ie(e,t){return t.tabs[e].can_start_call=(0,h.canStartGroupCall)(t,e),Promise.resolve(t)}function se(e,t,a,r,n){var i=n.imQueue(a),s=[],o=[];i.forEach((e=>{e.failed&&r&&e.mess.messageId!==r&&o.push(e),!e.failed||r&&e.mess.messageId!==r||s.push("rid"+e.rid)})),n.imQueueSet(a,o);var l=(0,g.getTab)(n,a);if(!l)return Promise.resolve(n);var c=o.length?o[o.length-1].mess:(0,g.getLastMessage)(e,a,s[0]);return l.lastmsg=c&&c.messageId,l.lastmsg_meta=c,s.forEach((e=>delete l.msgs[e])),l.history=(0,d.removeMessages)(s,(0,j.unpackHistory)(l.history)),(0,d.removeMessages)(s,t),Promise.resolve(n)}function oe(e,t,a){var r=864e5,n=a.imQueue(t),i=[],s=[],o=Date.now();return n.forEach((e=>{e.failed&&o-e.ts<r&&s.push(e),e.failed&&o-e.ts>=r&&i.push("rid"+e.rid)})),a.imQueueSet(t,s),a.tabs[t].history=(0,d.removeMessages)(i,(0,j.unpackHistory)(a.tabs[t].history)),(0,d.removeMessages)(i,e),Promise.resolve(a)}function le(e,t){return!1===(t.block_states[e]||{}).free?Promise.resolve(t):(0,r.post)(y.CONTROLLER,{act:"a_block",peer:e,prevPeer:t.prevPeer,gid:t.gid}).then((e=>{var a=$(e,1)[0];return(0,N.updateBlockStates)(a,t)}))}function ce(e,t){var a=t.peer;return Promise.resolve(t).then((t=>(t.tabHistoryNotChanged=!1,(0,d.isFullyLoadedTab)(t,a)&&!t.tabs[a].msgid?(t.gid&&le(a,t),Promise.resolve(t).then(P.setActions)):((0,d.isFullyLoadedTab)(t,a)&&(t.tabs[a].msgid=!1),(0,k.loadPeer)(t,a,0,e,!0,"selectPeer"))))).then(P.setActions).then(de.bind(null,a))}function de(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,d.isTabLoaded)(t,e)&&(t.tabs[e].last_touched=Date.now()),(0,d.isTabLoaded)(t,e)&&a&&(t.tabs[e].last_visited=Date.now()),t}function ue(e,t,a){var r=a.msgid,n=a.peer;return!e&&(0,d.isFullyLoadedTab)(a,n)&&a.tabs[n].msgs[r]?(t===a.peer?a.tabHistoryNotChanged=!0:a.tabHistoryNotChanged=!1,a.gid&&le(n,a),Promise.resolve(a).then(P.setActions).then(de.bind(null,n))):(0,k.loadPeer)(a,n,r,!0,!0,"selectOnMessage").then(P.setActions).then((()=>((0,g.getTab)(a,n).msgid=r,a))).then(de.bind(null,n))}function _e(e,t,a,r){if(ea(r))throw(0,d.showWaitUntilUploadedBox)(),new Error("Cant change peer while loading something");var n=r.gid?"gim"+r.gid:"im";if(r.prevPeer=r.peer,r.peer=e,r.msgid=t||"",r.currentEntryPoint=a,cur.peer=e,ee({sel:e?(0,d.convertPeerToUrl)(e):null,msgid:r.msgid,email:"",0:n}),0!==r.prevPeer&&de(r.prevPeer,r,!0),0!==e){(0,d.isTabLoaded)(r,e)&&de(e,r,!0),ha(r.tabbedPeers.map((e=>e.peer)).indexOf(e)<0?[{peer:e,type:"perm"}].concat(r.tabbedPeers):r.tabbedPeers.map((t=>(t.peer===e&&"perm"!==t.type&&(t.type="perm"),t))),!1,r);var i=(0,g.getTab)(r,e);i&&(0,M.tabIsMessageRequest)(i)&&(0,B.collectOpenMessageRequestStats)(e)}else ha(r.tabbedPeers,!1,r);return te(),(0,H.updateCounters)(location.href,document.referrer),lt(r.prevPeer,r)}var ge=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return a.membersLoaded?Promise.resolve(t):(0,r.post)(y.CONTROLLER,{act:"a_get_chat_members",chat:e,gid:t.gid,hash:a.hash}).then((e=>{var r=$(e,1),n=$(r[0],3),i=n[0],s=n[1],o=n[2];return a.memberIds=i,a.adminIds=s,o.forEach((e=>(0,p.oCacheAdd)(t,e))),a.membersLoaded=!0,t}))}));function me(e){var t=e.isMassMentionsMessageAllowed;cur.wallMentions=()=>new Promise(((a,r)=>{if(cur.wallMentions=[],!(0,d.isChatPeer)(e.peer)||!(0,d.isFullyLoadedTab)(e,e.peer)||(0,d.isFvkcomgroup)(e,e.peer))return r();var n=e.tabs[e.peer];function i(){var r=[];Object.keys(n.msgs||{}).reverse().forEach((e=>{var t=(0,g.parserMessage)(n.msgs[e]),a=t&&t.userId;a&&a!=vk.id&&-1===r.indexOf(a)&&(0,d.isUserAliveInChat)(n,a)&&r.push(a)})),(n.memberIds||[]).forEach((e=>{-1===r.indexOf(e)&&r.push(e)}));var i=[];r.forEach((t=>{if((0,p.oCacheExists)(e,t)){var a=(0,p.oCacheGet)(e,t),r=a.link.substring(1);i.push([a.id,a.name,"@"+r,a.photo,void 0,void 0,void 0,r,a.first_name,"",a.note])}}));var s=getLang("mail_im_mention_all"),o=getLang("mail_im_mention_online");t&&(0,h.canMassMention)(e)&&i&&i.length>1&&(_.MASS_MENTION_ALIASES.online.forEach((e=>i.push(["online",o,"@"+e,"/images/mention_online.svg",void 0,void 0,void 0,e,e,""]))),_.MASS_MENTION_ALIASES.all.forEach((e=>i.push(["all",s,"@"+e,"/images/mention_all.svg",void 0,void 0,void 0,e,e,""])))),a(i)}n.membersLoaded?i():ge(e.peer,e).then(i)}))}function pe(e,t,a){var n=a.tabs[a.peer];return(0,r.post)(y.CONTROLLER,{peer:a.peer,whole:e,act:"a_history",offset:n.offset+(n.skipped||0),toend:t,gid:a.gid}).then((e=>{var t=$(e,4),r=t[0],i=t[1],s=t[2],o=t[3];return n.allShown=s,a.admins=extend(a.admins,o),n.history=r+ne(n.history),n.historyToAppend=r,n.offset+=Object.keys(i).length,n.msgs=extend(n.msgs,i),a}))}function he(e){var t=e.tabs[e.peer];return(0,r.post)(y.CONTROLLER,{peer:e.peer,act:"a_history",rev:1,offset:t.skipped,gid:e.gid}).then((a=>{var r=$(a,5),n=r[0],i=r[1],s=r[2];r[3],r[4];t.allShown=t.allShown||s,t.history=ne(t.history)+n,t.historyToAppend=n;var o=Object.keys(i).length;return t.skipped-=o,t.offset+=o,t.msgs=extend(t.msgs,i),e}))}function fe(e,t,a,r,n){var s=e.tabs[t];if((0,G.partConfigEnabled)("me_web_read_by_cmid")){if(n===i.FLAG_OUTBOUND&&s.out_up_to_cmid>r)return e;n===i.FLAG_OUTBOUND?s.out_up_to_cmid=r:s.in_up_to_cmid=r}else{if(n===i.FLAG_OUTBOUND&&s.out_up_to>a)return e;n===i.FLAG_OUTBOUND?s.out_up_to=a:s.in_up_to=a}return e}var ve=(0,T.wrapHashAction)((function(e,t){if((0,M.tabIsMessageRequest)(t.tabs[e]))return Promise.resolve(t);var a=t.tabs[e],n=a.msgs||{},s=Object.keys(n).map((a=>(0,g.getMessage)(t,e,a))).filter((e=>!(0,m.isOut)(e))).map((e=>e.messageId)).sort(((e,t)=>t-e));a.skipped>0&&(s=s.filter((e=>intval(e)<=a.lastmsg-a.skipped))),s=intval(s.shift());var o=(0,g.getMessage)(t,e,s);if(!(0,m.isUnread)(a,o))return Promise.resolve(t);var l={};return(0,G.partConfigEnabled)("me_web_read_by_cmid")?(t.longpoll.push([i.readInboundByCmidEvent([10006,e,o.chat_local_id,null])]),l.start_cmid=o.chat_local_id):(t.longpoll.push([i.readInboundEvent([6,e,s,null])]),l.ids=[s]),(0,r.post)(y.CONTROLLER,Y({peer:e,hash:a.hash,act:"a_mark_read",gid:t.gid},l)).then((()=>fe(t,e,s,o.chat_local_id,i.FLAG_OUTBOUND))).catch((()=>t))})),be=(0,T.wrapHashAction)((function(e,t,a){var n=a.tabs[t];if(!(0,G.partConfigEnabled)("simplified_start_conversation")&&(0,M.tabIsMessageRequest)(n)||(0,d.tabIsOutgoingMessageRequest)(n))return Promise.resolve(a);var s=(0,g.getMessage)(a,t,e);if(!(0,m.isUnread)(n,s))return Promise.resolve(a);var o={};return(0,G.partConfigEnabled)("me_web_read_by_cmid")?(a.longpoll.push([i.readInboundByCmidEvent([10006,t,s.chat_local_id,null])]),o.start_cmid=s.chat_local_id):(a.longpoll.push([i.readInboundEvent([6,t,s.messageId,null])]),o.ids=[s.messageId]),(0,r.post)(y.CONTROLLER,Y({peer:t,hash:n.hash,act:"a_mark_read",gid:a.gid},o)).then((()=>fe(a,t,e,s.chat_local_id,i.FLAG_OUTBOUND)))}));function Ce(e){return(0,r.post)(y.CONTROLLER,{act:"a_get_key",uid:e.id,gid:e.gid}).then((t=>{var a=$(t,3),r=a[0],n=a[1],i=a[2];return extend({},e,{imKey:r,imUrl:n,imPart:i})}))}function Ee(e){return(0,r.post)(y.CONTROLLER,{act:"a_get_ts",gid:e.gid}).then((t=>{var a=$(t,1)[0];return extend({},e,{imTs:a})}))}function ye(e,t,a){var r=a.tabs[e];return r.msgs[t.messageId]&&(r.msgs[t.messageId].errored=1,r.history=(0,d.setMessageError)(e,t,(0,j.unpackHistory)(r.history))),Promise.resolve(a)}function Te(e,t,a,r){var n=r.tabs[e];return n.msgs[t]&&(n.msgs[t].errored=0,n.lastmsg_meta=a,n.lastmsg=t,n.history=(0,d.startResendMessage)(e,t,(0,j.unpackHistory)(n.history))),Promise.resolve(r)}function Ie(e,t){return 0===e.length?Promise.resolve(t):(0,r.post)(y.CONTROLLER,{act:"a_get_admin",admins:e.join(","),gid:t.gid}).then((e=>{var a=$(e,1)[0];return t.admins=extend(t.admins,a),t}))}function Ae(e,t){if(!inArray(e,t.tabbedPeers.map((e=>e.peer)))&&(0!==t.peer||t.searchText)&&!inArray(e,t.mutedPeers)){var a={peer:e,type:"temp"};ha(t.tabbedPeers.concat([a]),!1,t)}}function Le(e,t,a){return(0,M.isBusinessNotifyPeer)(a,e)?t:(0,d.isReversedDialogs)(a)?t.concat([e]):[e].concat(t)}function Se(e,t){var a=e.get().peer,r=(0,g.getTab)(e,a);if((0,d.isFullyLoadedTab)(e,a)){var n=(0,j.unpackHistory)(r.history);r.history=(0,d.updateMessageInCache)(e,n,t)}}function ke(e,t){var a=(0,g.getTab)(t,e.peerId);if((0,d.isFullyLoadedTab)(t,e.peerId)){var r=(0,j.unpackHistory)(a.history);a.msgs[e.messageId]=extend(!0,{},e),a.history=(0,d.editAndReplaceMessage)(t,e,r)}a&&a.lastmsg===e.messageId&&(a.lastmsg_meta=e);var n=a&&a.pinned&&(0,g.parserMessage)(a.pinned);if(n&&n.messageId===e.messageId&&(a.pinned=e),(0,d.isTabLoaded)(t,e.peerId)&&!(0,m.isOut)(e)&&(0,m.isUnread)(a,e)){var i=(0,S.hasUserMentions)(e,t.id),s=(0,G.partConfigEnabled)("me_web_read_by_cmid")?a.mention_cmids&&a.mention_cmids.includes(e.chat_local_id):a.mentions&&a.mentions.includes(e.messageId);i&&!s?(0,G.partConfigEnabled)("me_web_read_by_cmid")?(a.mention_cmids||(a.mention_cmids=[]),a.mention_cmids.push(e.chat_local_id)):(a.mentions||(a.mentions=[]),a.mentions.push(e.messageId)):!i&&s&&((0,G.partConfigEnabled)("me_web_read_by_cmid")?(0,P.setFilteredMentionsData)(e.peerId,(t=>t!==e.chat_local_id),t):(0,P.setFilteredMentionsData)(e.peerId,(t=>t!==e.messageId),t))}return Promise.resolve(t)}function Me(e,t){var a=e.flags&i.FLAG_OUTBOUND,r=e.peerId,n=Y({},e);if(delete n.minorSortId,(0,d.isTabLoaded)(t,r)){var s=t.tabs[r];if("number"==typeof e.messageId&&s.lastmsg>e.messageId)return Promise.resolve(t);s.deletedDialog=!1,e.local&&(t.msg_local_ids_sort=t.msg_local_ids_sort||{lastSortId:0},t.msg_local_ids_sort[e.messageId]=++t.msg_local_ids_sort.lastSortId);var o=(0,G.partConfigEnabled)("simplified_start_conversation")?!(0,M.tabIsNotImportantMessageRequest)(s):!(0,M.tabIsMessageRequest)(s);if(!a&&o)((0,G.partConfigEnabled)("me_web_read_by_cmid")?e.chat_local_id>s.in_up_to_cmid:e.messageId>s.in_up_to)&&(s.lastmsg===e.messageId&&s.unread?Ne(t,1,e.peerId):(!s.unread&&Ne(t,1,e.peerId),s.unread++)),E.casperMessagesStore.has(e.chat_local_id)&&!(0,g.isCasperChatTab)(s)&&((0,G.partConfigEnabled)("me_web_read_by_cmid")?(s.expiring_cmids||(s.expiring_cmids=[]),s.expiring_cmids.push(e.chat_local_id)):(s.expiring_messages||(s.expiring_messages=[]),s.expiring_messages.push(e.messageId))),(0,S.hasUserMentions)(e,t.id)&&((0,G.partConfigEnabled)("me_web_read_by_cmid")?(s.mention_cmids||(s.mention_cmids=[]),s.mention_cmids.push(e.chat_local_id)):(s.mentions||(s.mentions=[]),s.mentions.push(e.messageId))),Ae(e.peerId,t);else s.unread=0;if((0,d.isFullyLoadedTab)(t,r)){var l=(0,m.isMessageToBlockedCommunity)(s,e),c=l||0===s.offset;l&&(s.blocked_community=0),s.skipped>0&&s.skipped++,s.offset++,s.msgs[e.messageId]=n;var u=(0,j.unpackHistory)(s.history);s.history=(0,j.appendMessageToHistory)(t,e,u,!0,!0),c&&(0,P.setActions)(t)}if(s.typing){var _=s.typing.userIds.indexOf(e.userId);_>=0&&s.typing.userIds.splice(_,1)}return s.lastmsg=e.messageId,s.lastmsg_meta=n,s.minor_sort_id=e.minorSortId,de(e.peerId,t),(0,P.updateListedConvos)(t,s,!1,(e=>Le(r,e,t)),((e,a,r)=>na(t,e,a,r))),Promise.resolve(t)}return e.flags&i.FLAG_STEALTH?Promise.resolve(t):(0,k.loadPeer)(t,r,0,!1,!1,"addMessage").then((t=>{var n=t.tabs[r];return(0,P.updateListedConvos)(t,n,!1,(e=>Le(r,e,t)),((e,a,r)=>na(t,e,a,r))),de(e.peerId,t),a||Ae(e.peerId,t),t}))}function Ne(e,t,a){e.cur_unread_cnt||(e.cur_unread_cnt={}),-1===t&&delete e.cur_unread_cnt[a],(0,N.addToUnreadCounter)(t,a,e).then(x.updateUnreadCounter)}function we(e,t){var a=(0,g.getTab)(t,e.peerId);if((0,d.isFullyLoadedTab)(t,e.peerId)){var r=a.unread;if(t=fe(t,e.peerId,e.upToId,e.upToCmid,0),null!==e.unread?a.unread=e.unread:a.unread=(0,g.countUnread)(e.peerId,t)+(a.unread>0?+a.skipped:0),r>0&&!a.unread&&Ne(t,-1,e.peerId),!a.skipped){var n=(0,j.unpackHistory)(a.history);a.history=(0,j.removeNewUnreadBarAndMerge)(t,n,e.peerId)}}else(0,d.isTabLoaded)(t,e.peerId)&&(t.tabs[e.peerId].unread>0&&0===e.unread&&Ne(t,-1,e.peerId),t.tabs[e.peerId].unread=e.unread||0,(0,G.partConfigEnabled)("me_web_read_by_cmid")?t.tabs[e.peerId].in_up_to_cmid=e.upToCmid:t.tabs[e.peerId].in_up_to=e.upToId);return(0,d.isTabLoaded)(t,e.peerId)&&0===a.unread&&(t.dialog_tabs[u.FOLDER_UNREAD]=t.dialog_tabs[u.FOLDER_UNREAD].filter((t=>intval(t)!==e.peerId))),(0,d.isTabLoaded)(t,e.peerId)&&((0,G.partConfigEnabled)("me_web_read_by_cmid")?((0,P.setFilteredExpiringMessagesData)(e.peerId,(t=>t>e.upToCmid),t),(0,P.setFilteredMentionsData)(e.peerId,(t=>t>e.upToCmid),t)):((0,P.setFilteredExpiringMessagesData)(e.peerId,(t=>t>e.upToId),t),(0,P.setFilteredMentionsData)(e.peerId,(t=>t>e.upToId),t))),0!==(0,F.getUnreadCountWithMuted)(t)||t.active_tab!==u.FOLDER_UNREAD||t.gid?Promise.resolve(t):ra(u.FOLDER_ALL,t)}function Pe(e,t){var a=t.tabs[e.peerId];if((0,d.isTabLoaded)(t,e.peerId)&&fe(t,e.peerId,e.upToId,e.upToCmid,i.FLAG_OUTBOUND),(0,d.isFullyLoadedTab)(t,e.peerId)){var r=(0,j.unpackHistory)(a.history);a.history=(0,d.markMessagesAsRead)(t,e.peerId,r)}return Promise.resolve(t)}function Oe(e,t,a,r,n){return n.text={},n.imQueue=e,n.imQueueResend=t,n.imQueueSet=a,n.imQueueComplete=r,Promise.resolve(n)}function Re(e,t,a){function r(e,t){return{id:e.messageId,text:e.text,date:e.date,kludges:e.kludges,authorName:t}}if(1===e.length){var n=e[0],i=(0,g.getMessage)(a,t,n),s=(0,g.getAuthorFullName)(a,t,n);return!1===s?a.set(wt.bind(null,{[t]:[i.userId]})).then((a=>{var s=(0,g.getAuthorFullName)(a,t,n);return{msgIds:e,object:r(i,s)}})):Promise.resolve({msgIds:e,object:r(i,s)})}return Promise.resolve({msgIds:e})}function De(e,t,a,r){var n=(0,g.getTab)(r,e);if(n&&n.last_seen&&n.last_seen.can_see){var i=!1!==t?mobPlatforms[t]?1:0:n.last_seen.mobile;n.online=t,n.last_seen={platform:t,time:a||n.last_seen.time,mobile:i,can_see:n.last_seen.can_see}}var s=(0,d.convertLegacyOnlineToAPIFlags)(t),o=s.is_online,l=s.is_mobile;return(0,P.updateRecommendedListItemOnline)(r,e,o,l)}function Fe(e,t,a){var r=(0,g.getTab)(a,e.peerId);return r&&(e.ts=Date.now()/1e3,r.activity||(r.activity={}),r.activity[t]=e,r.typing===J&&(r.typing=e)),Promise.resolve(a)}function xe(e,t){var a=(0,g.getTab)(t,e.peerId),r=(0,m.isAudioMsg)(e)?"audiomessage":"typing";return a&&a.activity&&a.activity[r]&&(a.activity[r].userIds=a.activity[r].userIds.filter((t=>t!==e.userId))),Promise.resolve(t)}function He(e,t,a){var r=e.peerId;return(0,s.pause)(Q+2).then((()=>{if((0,d.isTabLoaded)(a,r)){var e=a.tabs[r];if((e.activity||{})[t])Date.now()-1e3*e.activity[t].ts>=1e3*Q&&(delete e.activity[t],0===Object.keys(e.activity).length&&delete e.activity);if(e.typing)Date.now()-1e3*e.typing.ts>=1e3*Q&&(e.typing=void 0)}return a}))}function Ue(e){var t={},a=e.find((e=>"poll"===e[0]));if(a){var r=$(a,3)[2];Object.assign(t,r)}return t}var Be=function(e,t,a,n){var i=Date.now()+rand(0,100).toFixed(0),s=n.ref_id,l=n.ref_source;n.ref_source=void 0,n.ref_id=void 0,(l||s)&&(ee({ref_source:null,ref:null}),te()),(0,v.statlogsSendingQueueLength)(n);var c="send",d=t.attaches.length>0,u=(0,v.statlogsSendingTime)(n,c,"server",d),_=Object.assign({act:"a_send",to:e,hash:a.hash,ref_source:l,ref:s,msg:t.message,payload:t.payload,media:(0,o.convertAttachesToPhpMedia)(t.attaches),guid:i,share_url:t.share_url,cancelled_shares:t.cancelled_shares,random_id:t.rid,gid:a.hidegid?void 0:n.gid,entrypoint:n.currentEntryPoint||"",sticker_referrer:t.sticker_referrer,module:cur.module},a.external,Ue(t.attaches));return(0,G.partConfigEnabled)("im_chasiky_debug")&&window.meBufferLog[t.rid].push("sending message",_),(0,r.post)(y.CONTROLLER,_,2e4).then((e=>{var a=$(e,1)[0];return(0,G.partConfigEnabled)("im_chasiky_debug")&&window.meBufferLog[t.rid]&&window.meBufferLog[t.rid].push("message sent",a),u(),n.version!==a.version&&nav.reload({force:!0}),n})).catch((e=>{throw(0,G.partConfigEnabled)("im_chasiky_debug")&&window.meBufferLog[t.rid]&&window.meBufferLog[t.rid].push("sending failed",e),(0,v.statlogsSendingError)(n,e,c,"server_send"),e}))},Ge=(0,T.wrapHashAction)((function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,n=r.tabs[e];return Be(e,t,Y({hash:n.hash},a),r)})),je=(0,T.wrapHashAction)((function(e,t,a){var n="edit",i=t.attaches.length>0,s=(0,v.statlogsSendingTime)(a,n,"server",i);return(0,r.post)(y.CONTROLLER,Object.assign({act:"a_edit_message",module:cur.module,hash:e.hash,id:t.messageId,peerId:e.peerId,gid:a.gid,msg:t.origText,media:(0,o.convertAttachesToPhpMedia)(t.attaches),share_url:t.share_url,cancelled_shares:t.cancelled_shares},Ue(t.attaches)),2e4).then((e=>{$(e,1)[0];return s(),a})).catch((e=>{throw(0,v.statlogsSendingError)(a,e,n,"server_send"),e}))}));function qe(e,t){if(t.selectedMessages||(t.selectedMessages=[]),1===e.length&&inArray(e[0],t.selectedMessages))t.selectedMessages=t.selectedMessages.filter((t=>t!==e[0]));else{var a=t.selectedMessages.concat(e);t.selectedMessages=(0,l.arrayUnique)(a).sort(((e,t)=>e-t))}return Promise.resolve(t)}function Ve(e){return e.selectedMessages=[],Promise.resolve(e)}function ze(e,t){if((0,G.partConfigEnabled)("im_chasiky_debug")&&delete window.meBufferLog[e.randomId],(0,d.isFullyLoadedTab)(t,e.peerId)){var a=t.tabs[e.peerId],r=Y({},e);delete r.minorSortId;var n=t.imQueue(e.peerId).filter((t=>t.failed&&t.rid!==e.randomId));t.imQueueSet(e.peerId,n),t.imQueueComplete(e.peerId,e.randomId),a.lastmsg_meta=r,a.lastmsg=e.messageId,a.minor_sort_id=e.minorSortId,a.msgs["rid"+e.randomId]&&(a.msgs[e.messageId]=r,delete a.msgs["rid"+e.randomId]),t.msg_local_ids_sort&&delete t.msg_local_ids_sort["rid"+e.randomId],a.history=(0,d.replaceMessageAttrs)(t,(0,j.unpackHistory)(a.history),r)}else console.error(new Error(`Tab ${e.peerId} not loaded on local message replace`));return Promise.resolve(t)}function Ye(e,t){var a="unknown",n=(0,v.statlogsSendingTime)(t,a,"attach"),i={act:"a_get_media",id:e.messageId,gid:t.gid};return(0,s.retryFn)(r.post,3,(e=>e*e))(y.CONTROLLER,i).then((a=>(n(),Ke(e,a,t)))).catch((r=>((0,v.statlogsSendingError)(t,r,a,"server_load_attach"),Ke(e,null,t))))}function $e(e,t){return(0,U.getFullMessage)(e.peerId,e.chat_local_id).then((a=>{var r=t.tabs[e.peerId],n=a.items[0].template;return n&&r.msgs&&(r.msgs[e.messageId].kludges.template=n),Promise.resolve(t)})).then((t=>function(e,t){var a=t.tabs[e.peerId];a.history&&(a.history=(0,d.replaceCarousel)((0,j.unpackHistory)(a.history),e,t));return Promise.resolve(t)}(e,t)))}function Ke(e,t,a){var r=a.tabs[e.peerId],n=t&&t[2];return r.mediacontent||(r.mediacontent={}),r.mediacontent[e.messageId]=t||[getTemplate("im_retry_link")],n&&(n.no_forward&&(r.msgs[e.messageId].kludges.no_forward=!0),n.no_pin&&(r.msgs[e.messageId].kludges.no_pin=!0)),function(e,t){var a=t.tabs[e.peerId];return a.history=(0,d.replaceAttaches)((0,j.unpackHistory)(a.history),e,t),Promise.resolve(t)}(e,a)}function We(e,t,a){var r=(0,d.dayFromVal)(t),n=a.tabs[e];return n.searchDay=r,n.searchOffset=0,n.searchAllLoaded=!1,n.searchMsgs=[],Promise.resolve(a)}function Qe(e,t,a){return a.tabs[t].searchText=e,dt(t,a),a}function Je(e,t,a){if(t){var r=a.tabs[t];r.searchText=e,r.searchOffset=0,r.searchAllLoaded=!1}else a.searchText=e,a.searchOffset=0,a.searchAllLoaded=!1;return Promise.resolve(a)}function Xe(e,t,a,r){return(0,k.searchHints)(e,t,a,{},r).then((e=>e.map((e=>({peerId:e.peerId,name:e.tab,photo:e.photo,online:e.online,is_friend:"friends"===a})))))}function Ze(e){return(t,a)=>e(a).then((e=>{var r=(t?e.search(t):e.list).map(O.getConvoInfoFromLocalIndex);return a.mapped_index||(a.mapped_index={}),r.forEach((e=>{a.mapped_index[e.peerId]=e})),r}))}var et=Ze((e=>e.topConvTree)),tt=Ze((e=>e.imTopConvTree)),at=Ze((e=>e.hintsTree));function rt(e,t){var a,n,i;t.topConvTree=new Promise((e=>{a=e})),t.hintsTree=new Promise((e=>{n=e})),t.imTopConvTree=new Promise((e=>{i=e}));var o=e?e.select(c.RECENT_SEARCH_OP):[];return(0,s.retryFn)(r.post,1,(()=>4))(y.CONTROLLER,{act:"a_dialogs_preload",rs:o.join(","),gid:t.gid}).catch((e=>[[],[],[]])).then((e=>{var r=$(e,4),s=r[0],o=r[1],l=r[2],c=r[3];return t.popular_sugg=l,new D.vkIndexer(s,(e=>e[1]),a),new D.vkIndexer(o,(e=>e[1]),n),c&&c.length>0?new D.vkIndexer(c,(e=>e[1]),i):i(),t}))}function nt(e){var t,a,n=e.active_tab,i=e.dialog_tabs[n];return i.length>0?i.forEach((r=>{var n=e.tabs[r],i=n.minor_sort_id,s=n.major_sort_id;(i||s)&&(void 0===t||t>s?(t=s,a=i):t===s&&a>i&&(a=i))})):(t=0,a=0),(0,r.post)(y.CONTROLLER,{act:"a_get_dialogs",start_message_id:a,major_sort_id:t,tab:n,gid:e.gid,tags:n===u.FOLDER_PEER_TAGS&&e.peer_tags_filter?e.peer_tags_filter.mask:null}).then((t=>{var a=$(t,4),r=a[0],s=a[1],o=a[2],l=a[3];return o.forEach((t=>(0,p.oCacheAdd)(e,t))),(0,N.updateBlockStates)(l,e),(0,P.mergeTabs)(e,s),e.dialog_tabs[n]=i.filter((e=>!s[e])).concat(Object.keys(s).map(intval)),(0,g.isCommunityInterface)(e)||(e.dialog_tabs[n]=(0,V.getFilteredConvoList)(e,e.dialog_tabs[n],n)),e.dialog_tabs_all[n]=!r.has_more,Promise.resolve(e)}))}var it=(0,T.wrapHashAction)((function(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_search",q:e,from:"all",gid:t.gid,hash:t.writeHash,offset:t.searchOffset||0}).then((a=>{var r=$(a,5),n=r[0],i=r[1],s=r[2],o=r[3],l=r[4];return i.forEach((e=>(0,p.oCacheAdd)(t,e))),(0,d.normalizeTabsGotFromServer)(t,n),e===t.searchText&&(t.searchOffset=o,t.searchAllLoaded=l),Object.keys(n).filter((e=>!t.tabs[e])).forEach((e=>{t.tabs[e]=n[e]})),[n,s]}))}));function st(e,t){return t.tabs[e].searchAllLoaded}function ot(e,t){return!(t.peer!==e||!(0,d.isFullyLoadedTab)(t,e))&&t.tabs[e].inplaceSearch}function lt(e,t){if((0,d.isFullyLoadedTab)(t,e)){var a=t.tabs[e];delete a.inplaceSearch,delete a.searchOffset,delete a.searchAllLoaded,delete a.searchText,delete a.searchDay,delete a.searchMsgs,ee({st:""}),te()}return Promise.resolve(t)}function ct(e,t){if((0,d.isFullyLoadedTab)(t,e)){var a=t.tabs[e];delete a.searchDay,a.searchOffset=0,a.searchAllLoaded=!1,a.searchMsgs=[]}return Promise.resolve(t)}function dt(e,t){return t.tabs[e].inplaceSearch=!0,Promise.resolve(t)}var ut=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e],n="";if(dt(e,t),a.searchDay&&(n=`day:${a.searchDay}`),!n&&!a.searchText)return Promise.reject();var i=`in:${e} ${n} ${a.searchText||""}`;return ee({st:a.searchText}),te(),(0,r.post)(y.CONTROLLER,{act:"a_search",q:i,from:"in",gid:t.gid,hash:t.writeHash,offset:a.searchOffset||0}).then((e=>{var t=$(e,4),r=t[0],n=t[1],i=t[2],s=t[3];return a.searchOffset=n,a.searchAllLoaded=i,a.searchMsgs=(a.searchMsgs||[]).concat(s),r}))}));function _t(e){return(0,r.post)(y.CONTROLLER,{act:"a_important",offset:e,part:e>0})}function gt(e,t){var a=(0,g.getTab)(e,t);return(0,r.post)(y.CONTROLLER,{act:"a_load_lastmsg",peerId:t,gid:e.get().gid}).then((r=>{var n=$(r,4),i=n[0],s=n[1],o=n[2],l=n[3],c=intval(i[0]),_=(0,C.unpackStore)(e);!c&&(0,M.isBusinessNotifyTab)(a)&&(_.dialog_tabs[u.FOLDER_BUSINESS_NOTIFY]=_.dialog_tabs[u.FOLDER_BUSINESS_NOTIFY].filter((e=>e!==t))),!(0,d.isLastMsgDebugEnabled)(e)||c||!1===a.lastmsg||(0,M.isBusinessNotifyTab)(a)||(console.log(Y({},a)),(0,d.showDebugAlert)(!0)),a.lastmsg=c||!1,a.lastmsg_meta=i;var g=$(s,5);a.unread=g[0],a.in_up_to=g[1],a.out_up_to=g[2],a.in_up_to_cmid=g[3],a.out_up_to_cmid=g[4],(0,G.partConfigEnabled)("me_web_read_by_cmid")?(o?a.mention_cmids=o:a.mention_cmids&&delete a.mention_cmids,l?a.expiring_cmids=l:a.expiring_cmids&&delete a.expiring_cmids):(o?a.mentions=o:a.mentions&&delete a.mentions,l?a.expiring_messages=l:a.expiring_messages&&delete a.expiring_messages),a.unread||(_.dialog_tabs[u.FOLDER_UNREAD]=_.dialog_tabs[u.FOLDER_UNREAD].filter((e=>intval(e)!==t))),(0,P.updateListedConvos)(_,a,!1,(e=>Le(t,e,_)),((e,t,a)=>na(_,e,t,a)))}))}function mt(e,t,a){if((0,d.isFullyLoadedTab)(a,t)){var r=a.tabs[t];r.deleted=r.deleted?r.deleted.concat(e):e}return Promise.resolve(a)}function pt(e,t,a){if((0,d.isFullyLoadedTab)(a,t)){var r=a.tabs[t];if(r.history=(0,d.removeMessages)(e,(0,j.unpackHistory)(r.history)),r.offset-=e.filter((e=>r.msgs[e])).length,e.forEach((e=>delete r.msgs[e])),e.forEach((e=>{var t=(a.selectedMessages||[]).indexOf(e);-1!=t&&a.selectedMessages.splice(t,1)})),r.inplaceSearch){var n=e.reduce(((e,t)=>(e[t]=!0,e)),{});r.searchMsgs=r.searchMsgs.filter((e=>!n[e])),r.searchOffset=r.searchMsgs.length}}return Promise.resolve(a)}var ht=(0,T.wrapHashAction)((function(e,t,a,n,i){return(0,r.post)(y.CONTROLLER,{act:"a_mark",peer:t,hash:a||i.tabs[t].hash,gid:i.gid,msgs_ids:e.join(","),mark:n})}));function ft(e,t,a,r){if((0,d.isFullyLoadedTab)(r,t)){var n=r.tabs[t];n.deleted=n.deleted?n.deleted.concat(e):e,n.history=(0,d.removeMessagesWithRestore)(e,t,a,(0,j.unpackHistory)(n.history)),n.offset-=e.filter((e=>n.msgs[e])).length}return Promise.resolve(r)}function vt(e,t,a){if((0,d.isFullyLoadedTab)(a,t)){var r=a.tabs[t];r.deleted&&(r.deleted=r.deleted.filter((t=>t!==e))),r.history=(0,d.restoreMessage)(e,t,(0,j.unpackHistory)(r.history)),r.offset++}return Promise.resolve(a)}function bt(e,t,a,n){return(0,r.post)(y.CONTROLLER,{act:"a_restore",id:e,peer:t,hash:a,gid:n})}var Ct=(0,T.wrapHashAction)((function(e,t,a){return(0,M.tabIsMessageRequest)(a.tabs[e])?Promise.resolve(a):(a.tabs[e].lastTyping=Date.now(),(0,r.post)(y.CONTROLLER,{act:"a_activity",type:t,peer:e,gid:a.gid,hash:a.tabs[e].hash}).then((()=>a),(()=>a)))})),Et=(0,T.wrapHashAction)(((e,t)=>(0,r.post)(y.CONTROLLER,{act:"a_accept_message_request",peer_id:e,hash:t.tabs[e].hash}).then((()=>{var a=t.tabs[e];return a.is_message_request=!1,a.folders=(0,g.removeMessageRequestFolderFlags)(a.folders),t})))),yt=(0,T.wrapHashAction)(((e,t,a)=>(0,r.post)(y.CONTROLLER,{act:"a_reject_message_request",peer_id:e,is_spam:Number(t),hash:a.tabs[e].hash}).then((()=>((0,P.updateListedConvos)(a,a.tabs[e],!0,(t=>t.filter((t=>t!==Number(e))))),ha(a.tabbedPeers.filter((t=>t.peer!==e)),!0,a),a))))),Tt=(0,T.wrapHashAction)((function(e,t){return Ct(e,J,t)})),It=(0,T.wrapHashAction)((function(e,t){return Ct(e,X,t)}));function At(e,t,a,r){return t&&(r.pendingForward=null,e||(e={msgIds:[]}),t.addAttach(a?"reply":"mail",e.msgIds.join(";"),e.object||null)),Promise.resolve(r)}function Lt(e,t){return t.pendingForward=e,Promise.resolve(t)}function St(e,t,a){if(!(0,d.isTabLoaded)(a,e))return Promise.resolve(a);a.blockedFlagUpdates||(a.blockedFlagUpdates={}),a.blockedFlagUpdates[e]=!0;var r=a.tabs[e];return(0,P.updateListedConvos)(a,r,!0,(t=>t.filter((t=>t!==e)))),r.unread>0&&((0,G.partConfigEnabled)("simplified_start_conversation")?!(0,M.tabIsNotImportantMessageRequest)(r):!(0,M.tabIsMessageRequest)(r))&&!(0,M.isBusinessNotifyTab)(r)&&Ne(a,-1,e),r.deletedDialog=!0,ha(a.tabbedPeers.filter((t=>t.peer!==e)),!0,a),t.then((t=>{var n=$(t,2);n[0],n[1];return delete a.blockedFlagUpdates[e],r.msgs=null,r.history=null,r.unread=0,r.lastmsg=!1,r.lastmsg_meta=null,a}))}var kt=(0,T.wrapHashAction)((function(e,t){return St(e,(0,r.post)(y.CONTROLLER,{act:"a_flush_history",id:e,from:"im",gid:t.gid,hash:t.tabs[e].hash}),t)})),Mt=(0,T.wrapHashAction)((function(e,t,a){return(0,r.post)(y.CONTROLLER,{act:"a_set_chat_title",peer:e,new_title:t,gid:a.gid,hash:a.tabs[e].hash}).then((()=>(a.onUpdate&&a.onUpdate(),a)))})),Nt=(0,T.wrapHashAction)((function(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_load_chat_info",peer:e,gid:t.gid,hash:t.tabs[e].hash}).then((a=>{var r=$(a,1)[0];return t.tabs[e]=extend(t.tabs[e],r),t}))}));function wt(e,t){if(isEmpty(e))return Promise.resolve(t);var a=Object.keys(e).map((t=>`${t}:${e[t].join(",")}`)).join(";");return(0,r.post)(y.CONTROLLER,{act:"a_load_member",need:a,gid:t.gid}).then((e=>($(e,1)[0].forEach((e=>(0,p.oCacheAdd)(t,e))),t)))}function Pt(e,t,a){var r={},n=a.get();function s(e,t){(0,d.isChatPeer)(e)&&t&&!(0,p.oCacheExists)(n,t)&&(r[e]?-1===r[e].indexOf(t)&&r[e].push(t):r[e]=[t])}var o=t.filter((e=>!(0,d.isTabLoaded)(n,e.peerId))).map((e=>e.peerId));t.forEach((e=>{s(e.peerId,e.userId)})),e.forEach((e=>{s(e.peerId,Number(e.kludges.source_mid)),s(e.peerId,Number(e.kludges.from))}));var l=t.filter((e=>e.flags&i.FLAG_OUTBOUND&&!e.local)).map((e=>e.kludges.from_admin)).filter((e=>e&&!n.admins[e]));return 0===Object.keys(r).length&&0===l.length&&0===o.length?Promise.resolve(n):{shouldLoad:Object.keys(r).length>0||l.length>0||o.length>0,needMembers:r,needAdminIds:l,needPeers:o}}function Ot(e,t,a){var r=e.needMembers,n=e.needAdminIds,i=e.needPeers;return t.pause(),Promise.all([wt(r,a),Ie(n,a),Promise.all(i.map((e=>(0,k.loadPeer)(a,e,0,!1,!1,"loadPeople"))))]).catch((()=>a)).then((()=>t.resume())).then((()=>a))}var Rt=(0,T.wrapHashAction)((function(e,t){return e.kludges.source_act===d.CHAT_PHOTO_REMOVE?(delete t.tabs[e.peerId].photo,delete t.tabs[e.peerId].photoLarge,Promise.resolve(t)):(t.onUpdate&&t.onUpdate(),(0,r.post)(y.CONTROLLER,{act:"a_get_chat_photo",msg_id:e.messageId}).then((a=>{var r=$(a,2),n=r[0],i=r[1];t.chat_photo_msg=i;var s=t.tabs[e.peerId];if(t.tabs[e.peerId].photo=n[0],t.tabs[e.peerId].photoLarge=n[1],(0,d.isFullyLoadedTab)(t,e.peerId)){var o=e.kludges.source_act;s.history=(0,d.addChatPhotoToUpdate)(e,o,t,(0,j.unpackHistory)(s.history))}return t})))}));function Dt(e,t,a,r){return t!==vk.id||(0,d.isTabLoaded)(r,a)&&r.peer==a&&(r=(0,P.setActions)(r)),Promise.resolve(r)}var Ft=(0,T.wrapHashAction)((function(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_leave_chat",chat:e-2e9,gid:t.gid,hash:t.tabs[e].hash}).then(Dt.bind(null,d.CHAT_KICK_USER,vk.id,e,t))})),xt=(0,T.wrapHashAction)((function(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_return_to_chat",chat:e-2e9,gid:t.gid,hash:t.tabs[e].hash}).then(Dt.bind(null,d.CHAT_INVITE_USER,vk.id,e,t))})),Ht=(0,T.wrapHashAction)((function(e,t,a,n){return(0,r.post)(y.CONTROLLER,{act:"a_mute",peer:e,hash:n.tabs[e].hash,gid:n.gid,value:Number(t),until:a}).then((()=>{var a=t?"mute":"unmute";return window.Notifier&&Notifier.lcSend("im",{act:a,peer:e}),n})).then(Bt.bind(null,e,t))})),Ut=(0,T.wrapHashAction)((function(e,t,a){return(0,r.post)(y.CONTROLLER,{act:"a_mute_mentions",peer:e,hash:a.tabs[e].hash,gid:a.gid,value:Number(t)}).then((()=>a))}));function Bt(e,t,a){var r=a.mutedPeers.filter((t=>t!==e));return t&&r.push(e),a.mutedPeers=r,cur.mutedPeers=a.mutedPeers,(0,P.setActions)(a)}function Gt(e,t){return t.stack=e,Promise.resolve(t)}var jt=(0,T.wrapHashAction)((function(e,t,a,n){return qt(e,a,t,n),(0,r.post)(y.CONTROLLER,{act:"a_mark_important",ids:e,val:t?1:0,from:"im",gid:n.gid,peer:a,hash:n.tabs[a].hash}).then((()=>n))}));function qt(e,t,a,r){if((0,d.isFullyLoadedTab)(r,t)){var n=r.tabs[t];e.filter((e=>n.msgs[e])).forEach((e=>{var s=(0,g.getMessage)(r,t,e),o=a?s.flags|i.FLAG_IMPORTANT:s.flags&~i.FLAG_IMPORTANT;s.flags=o,n.msgs[e]=s,n.history=(0,d.updateStar)(e,a,(0,j.unpackHistory)(n.history))}))}return Promise.resolve(r)}function Vt(e,t,a){return a.importants||(a.importants={}),(a.importants[t]||0)!==e&&(a.important_cnt+=e,a.importants[t]=e),Promise.resolve(a)}function zt(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_spam",offset:e,gid:t,part:e>0})}function Yt(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_flush_spam",gid:t,hash:e})}function $t(e,t,a){return a.creationType=e,a.creationFilter=t,Promise.resolve(a)}function Kt(e,t){return(0,R.ownerPhoto)(JSON.parse(e).data[0],t)}function Wt(e){return(0,r.post)(y.CONTROLLER,{act:"a_get_contacts"}).then((t=>{var a=$(t,1)[0];return e.contactsList=a,e}))}function Qt(e,t){return t.next_chat_avatar=e,Promise.resolve(t)}function Jt(e){var t;e.resync_in_process=new Promise((e=>{t=e}));var a=Object.keys(e.tabs).length,n=e.active_tab;return(0,l.lplog)("Resync started"),(0,G.partConfigEnabled)("im_chasiky_debug")&&window.meBufferLog&&(window.meBufferLog.resync={timestamp:Date.now(),ts:window.lpConnect.options.ts}),(0,r.post)(y.CONTROLLER,{act:"a_resync",sel:e.peer,gid:e.gid,loaded:a,tab:n,add_peers:e.tabbedPeers.map((e=>e.peer)).join(",")}).then((a=>{var r=$(a,5),i=r[0],s=r[1],o=r[2],c=r[3],_=r[4];s.forEach((t=>(0,p.oCacheAdd)(e,t))),(0,d.normalizeTabsGotFromServer)(e,i),(0,l.lplog)("Resync success","success");var g,m=e.peer;if((0,d.isReservedPeer)(m))g=Promise.resolve(!1);else{var h={tabs:{[m]:e.tabs[m]},oCache:{},imQueueComplete:e.imQueueComplete};g=(0,P.mergeTabs)(h,{[m]:i[m]})}return g.then((a=>{e.tabs=i,e.admins=extend(e.admins,c),a&&(e.tabs[m]=a.tabs[m],e.tabs[m].history=(0,k.restoreQueuedMessagesInDom)(e,m,(0,j.unpackHistory)(e.tabs[m].history))),e.loadingDialogs=!1,e.mutedPeers=o.mutedPeers,e.lastDialogsOptions={has_more:o.has_more},e.dialog_tab_cts=o.folder_cts,e.dialog_tabs[n]=_.map(intval),e.dialog_tabs_all[n]=!1;for(var r=e.dialog_tabs[n].map((t=>e.tabs[t])),s=0,l=Object.keys(e.dialog_tabs);s<l.length;s++){var d=l[s];if(n!==d){var g=[];if(n===u.FOLDER_ALL){var p,h=z(r);try{for(h.s();!(p=h.n()).done;){var f=p.value;(0,O.getFilterFnForConvoListFolder)(d)(f)&&g.push(f.peerId)}}catch(e){h.e(e)}finally{h.f()}}e.dialog_tabs_all[d]=!1,e.dialog_tabs[d]=g}}return delete e.resync_in_process,setTimeout(t.bind(null,!0),0),(0,N.setUnreadCounters)(o,e)}))})).then((e=>((0,x.updateUnreadCounter)(e),e))).catch((t=>((0,l.lplog)("Resync error: "+t.message+" "+t.stack,"error"),(0,s.pause)(2).then(Jt.bind(null,e)))))}function Xt(e,t){return t.lockedSending=e,Promise.resolve(t)}function Zt(e,t,a){return e&&!a.delayed_message?(a.delayed_message=e,a.delayed_ts=t):e||(a.delayed_message=e,a.delayed_ts=t),Promise.resolve(a)}function ea(e){return!!e.textMediaSelector.urlAttachmentLoading||!!(window.Upload&&Upload.options&&Upload.isSomethingUploading)&&Object.keys(Upload.options).filter((e=>Upload.isSomethingUploading(e))).length>0}function ta(e,t,a){a.cur_unread_cnt||(a.cur_unread_cnt={}),t&&!inArray(e,a.mutedPeers)&&(a.cur_unread_cnt[e]=!0);var r=document.title,n=window.devicePixelRatio>=2?"_2x":"";if(t&&!a.update_title_to){var i=function(e,t,a){return function(){a.update_old_title=e;var r=Object.keys(a.cur_unread_cnt).length;if(0===r)return(0,b.setDocumentTitle)(e||document.title),setFavIcon("/images/icons/favicons/fav_im"+t+".ico"),clearInterval(a.update_title_to),void(a.update_title_to=!1);e?((0,b.setDocumentTitle)(e),setFavIcon("/images/icons/favicons/fav_im"+t+".ico"),e=!1):(e=document.title,setFavIcon("/images/icons/favicons/fav_im"+(r>9?10:r)+t+".ico"),(0,b.setDocumentTitle)(winToUtf(getLang("mail_im_new_messages",r))))}}(r,n,a);a.update_title_to=setInterval(i,1e3),i()}else!t&&a.update_old_title&&((0,b.setDocumentTitle)(a.update_old_title),a.cur_unread_cnt={},r=!1,a.update_old_title=!1,setFavIcon("/images/icons/favicons/fav_im"+n+".ico"),clearInterval(a.update_title_to),a.update_title_to=!1);return Promise.resolve(a)}function aa(e,t,a,r,n){return(0,d.isFullyLoadedTab)(n,e)&&(n.tabs[e].scrollTop=intval(t),n.tabs[e].scrollBottom=intval(a),n.tabs[e].contHeight=intval(r)),Promise.resolve(n)}function ra(e,t){var a=t.active_tab;if(t.active_tab=e,(0,n.updateLocation)({tab:e===u.FOLDER_ALL?null:e,tags:e===u.FOLDER_PEER_TAGS&&t.peer_tags_filter?t.peer_tags_filter.mask:null}),e!==u.FOLDER_ALL&&!(0,d.isReversedDialogs)(t)){var r=t.dialog_tabs[e],i=(0,V.getFilteredConvoList)(t,t.dialog_tabs[u.FOLDER_ALL],e);t.dialog_tabs[e]=r.length>=i.length?r:i}return a===u.FOLDER_PEER_TAGS&&e!==a&&(t.peer_tags_filter.ids=[],(0,w.renderPeerTagsFilter)(t),(0,w.renderPeerTagsFilterPane)(t)),Promise.resolve(t)}function na(e,t,a,r){var n=e.dialog_tabs_all;return!(t===u.FOLDER_BUSINESS_NOTIFY&&!r.lastmsg)&&(!(!n[u.FOLDER_ALL]&&!n[t])||(!!a.includes(r.peerId)||("r"===r.lastmsg[0]||a.map((t=>e.tabs[t.toString()])).filter((t=>(0,d.isReversedDialogs)(e)?t.major_sort_id>r.major_sort_id||t.minor_sort_id>r.minor_sort_id:t.major_sort_id<r.major_sort_id||t.minor_sort_id<r.minor_sort_id)).length>0)))}function ia(e,t,a,r,n,s){if((0,d.isTabLoaded)(s,e)&&!n){var o=s.tabs[e];return a===i.REPLACE_DIRECTORIES&&(t^=o.folders),function(e,t,a){return!(e===i.SET_DIRECTORIES&&a.folders&t||!(e!==i.RESET_DIRECTORIES||a.folders&t)||((0,G.partConfigEnabled)("simplified_start_conversation")?(0,M.tabIsNotImportantMessageRequest)(a):(0,M.tabIsMessageRequest)(a)))}(a,t,o)&&Object.keys(u.FOLDER_MASKS).filter((e=>u.FOLDER_MASKS[e]&t)).forEach((e=>{var t=s.dialog_tab_cts[e];t&&(t.total=(0,q.getConvoListFolderCounterDisplayed)(s,e)+function(e,t,a){return t!==i.RESET_DIRECTORIES||e.folders&u.FOLDER_MASKS[a]?t===i.REPLACE_DIRECTORIES?e.folders&u.FOLDER_MASKS[a]?-1:1:t===i.SET_DIRECTORIES?1:-1:0}(o,a,e))})),a===i.SET_DIRECTORIES?s.tabs[e].folders|=t:a===i.RESET_DIRECTORIES?s.tabs[e].folders&=~t:s.tabs[e].folders=t^=o.folders,(0,P.updateListedConvos)(s,s.tabs[e],!0,((t,a)=>a===u.FOLDER_PEER_TAGS?t:(0,V.getFilteredConvoList)(s,[...t,e],a)),((e,t,a)=>na(s,e,t,a))),Promise.resolve(s)}return(0,k.loadPeer)(s,e,0,!1,!1,"updateFolders").then((()=>ia(e,t,a,null,!1,s)))}var sa=(0,T.wrapHashAction)((function(e,t){var a=u.FOLDER_MASKS[u.FOLDER_IMPORTANT],n=t.tabs[e].folders&a,s=n?i.resetDirectoriesEvent:i.setDirectoriesEvent;return t.longpoll.push([s([0,e,a,!0])]),(0,r.post)(y.CONTROLLER,{act:"a_dialog_star",val:n?0:1,peer:e,hash:t.tabs[e].hash,gid:t.gid}).then((()=>t))})),oa=(0,T.wrapHashAction)((function(e,t){var a=u.FOLDER_MASKS[u.FOLDER_UNRESPOND],n=t.tabs[e];if(n)return(0,G.partConfigEnabled)("me_web_read_by_cmid")?t.longpoll.push([i.resetDirectoriesEvent([0,e,a,!0]),i.readInboundByCmidEvent([10006,e,n.lastmsg_meta.chat_local_id,null])]):t.longpoll.push([i.resetDirectoriesEvent([0,e,a,!0]),i.readInboundEvent([6,e,n.lastmsg,null])]),(0,r.post)(y.CONTROLLER,{act:"a_mark_answered",peer:e,lastmsg:n.lastmsg,hash:t.tabs[e].hash,gid:t.gid}).then((()=>t))})),la=(0,T.wrapHashAction)(((e,t)=>(t.longpoll.push([(0,L.resetPeer)(),i.setDirectoriesEvent([0,e,u.FOLDER_MASKS[u.FOLDER_MARKED_UNREAD],!0])]),(0,r.post)(y.CONTROLLER,{act:"a_mark_conversation_as_unread",peer_id:e,hash:t.tabs[e].hash,gid:t.gid})))),ca=(0,T.wrapHashAction)(((e,t)=>{t.longpoll.push([i.resetDirectoriesEvent([0,e,u.FOLDER_MASKS[u.FOLDER_MARKED_UNREAD],!0])]);var a=t.tabs[e],n=(0,G.partConfigEnabled)("me_web_read_by_cmid")?{start_cmid:(0,f.getLastMeta)(t,e).chat_local_id}:{ids:[a.lastmsg]};return(0,r.post)(y.CONTROLLER,Y({peer:e,mark_conversation_as_read:!0,hash:a.hash,act:"a_mark_read",gid:t.gid},n)).then((()=>t))}));function da(e){return(0,r.post)(y.CONTROLLER,{act:"a_get_mutex_key",gid:e})}function ua(e,t){return(0,N.updateBlockStates)({[e]:{free:!0}},t),(0,r.post)(y.CONTROLLER,{act:"a_block_release",peer:e,gid:t.gid}).then((()=>t))}function _a(e,t){var a=ls.get("comm_mute_"+t.gid)?1:0;return e&&(a^=1),ls.set("comm_mute_"+t.gid,a),t.mute=a,Promise.resolve(t)}var ga=(0,T.wrapHashAction)((function(e,t){return(0,P.updateListedConvos)(t,t.tabs[e],!0,(t=>t.filter((t=>t!==e)))),t.tabs[e].deletedDialog=!0,(0,r.post)(y.CONTROLLER,{act:"a_delete_dialog",peer:e,gid:t.gid,hash:t.tabs[e].hash}).then((a=>(a[0]?(ha(t.tabbedPeers.filter((t=>t.peer!==e)),!0,t),t.tabs[e].unread=0,t.tabs[e].lastmsg=!1,t.tabs[e].lastmsg_meta=null):(t.tabs[e].deletedDialog=!1,(0,P.updateListedConvos)(t,t.tabs[e],!1,(a=>Le(e,a,t)),((e,a,r)=>na(t,e,a,r)))),a)))}));function ma(e,t,a,n){return(0,r.post)(y.CONTROLLER,{act:"a_restore_dialog",hash:t,gid:n.gid,spam:a?1:0,peer:e}).then((t=>(n.tabs[e].deletedDialog=!1,(0,P.updateListedConvos)(n,n.tabs[e],!1,(t=>[e].concat(t))),n.tabs[e].unread=t,n)))}function pa(e,t,a){return(0,r.post)(y.CONTROLLER,{act:"a_spam_dialog",peer:e,gid:a.gid,hash:t})}function ha(e,t,a){return a.tabbedPeers=e,(0,d.isClassicInterface)(a)&&(ee({peers:a.tabbedPeers.filter((e=>{var t=e.peer,r=e.type;return t!==a.peer&&"perm"===r})).map((e=>(0,d.getBareTab)(e.peer,a))).filter((e=>!e.deletedDialog)).map((e=>e.peerId)).map(d.convertPeerToUrl).join("_"),to:""}),t&&te()),Promise.resolve(a)}function fa(e){return!e.peer||(ot(e.peer,e)?st(e.peer,e):!!(0,d.isFullyLoadedTab)(e,e.peer)&&e.tabs[e.peer].allShown)}function va(e,t){var a=t.tabs[e];return(0,d.isFullyLoadedTab)(t,e)&&(a.skipped=null,a.msgs=null,a.offset=null,a.allShown=null,a.history=null),Promise.resolve(t)}function ba(e,t){var a=t.tabs[e];return(0,d.isFullyLoadedTab)(t,e)&&(a.history=ne(a.history)),Promise.resolve(t)}function Ca(e,t){return t.go_to_end_visible=e,Promise.resolve(t)}function Ea(e,t){return t.go_to_mentions_visible=e,Promise.resolve(t)}function ya(e,t,a){if(!(0,d.isCommunityPeer)(t))return Promise.resolve(a);var n=(0,g.getTab)(a,t);return n.blocked_community=!e,!1===e&&(n.can_send_notify=!1),(0,r.post)(y.CONTROLLER,{act:"a_toggle_community",peer_id:t,hash:n.hash,state:e?1:0}).then((()=>(0,P.setActions)(a)))}function Ta(e){if(0!==e.peer&&(0,d.isFullyLoadedTab)(e,e.peer)){var t=(0,g.getTab)(e,e.peer),a=geByClass1("_im_peer_history");a&&(t.history=(0,j.unpackHistory)(a.innerHTML))}return Promise.resolve(e)}function Ia(e){return e.audio_msg.isRecording=!1,Promise.resolve(e)}function Aa(e,t){return t.voice_message_available=e,Promise.resolve(t)}function La(e){ee({act:e?"create":null}),te()}function Sa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ee({q:e}),te()}function ka(e){return void 0===e.chatResizeInitialized&&(e.chatResizeInitialized=!0,(0,d.getClassicChatHeight)()>window.clientHeight()&&(0,d.setClassicChatHeight)(0)),Promise.resolve(e)}var Ma=(0,T.wrapHashAction)((function(e,t,a,n){return(0,r.post)(y.CONTROLLER,{act:"a_join_chat",chat_id:e,hash:t,invite_link:a,write_hash:n.writeHash}).then((e=>{var t=$(e,4),a=t[0],r=t[1],i=t[2],s=t[3];return i.forEach((e=>(0,p.oCacheAdd)(n,e))),n.tabs[a]=r,(0,P.updateListedConvos)(n,r,!1,(e=>Le(a,e,n)),((e,t,a)=>na(n,e,t,a))),n.admins=extend(n.admins,s),[a]}))}));function Na(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_get_link",gid:t.gid,chat_id:e})}var wa=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_reset_link",chat_id:e-2e9,write_hash:t.writeHash,gid:t.gid}).then((e=>(a.inviteLink=e[0],e)))}));function Pa(e){return ae({invite_chat_id:null,invite_hash:null,mr:null,invite_link:null}),e.invitation=void 0,Promise.resolve(e)}function Oa(e,t){var a=(0,l.arrayUnique)([e].concat(t.select(c.RECENT_SEARCH_OP))).slice(0,500);t.update(c.RECENT_SEARCH_OP,a)}function Ra(e){e.update(c.RECENT_SEARCH_OP,[])}function Da(e,t){var a=t.select(c.RECENT_SEARCH_OP).filter((t=>t!==e));return t.update(c.RECENT_SEARCH_OP,a),a}function Fa(e,t,a){var r=a.tabs[t],n=(0,g.getMessage)(a,t,e);return(0,g.isChatActive)(r)&&!n.kludges.source_act&&(r.pinned=n),Promise.resolve(a)}function xa(e,t){return t.tabs[e].pinned=null,Promise.resolve(t)}var Ha=(0,T.wrapHashAction)((function(e,t,a){var n=a.tabs[t];return(0,g.isChatActive)(n)?(0,r.post)(y.CONTROLLER,{act:"a_pin_message",msgid:e,chat:t,gid:a.gid,hash:a.tabs[t].hash}).then((e=>{var r=$(e,1)[0];return a.tabs[t]=Object.assign({},n,r),a})):Promise.resolve(a)})),Ua=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return(0,g.isChatActive)(a)?(0,r.post)(y.CONTROLLER,{act:"a_unpin_message",chat:e,gid:t.gid,hash:t.tabs[e].hash}).then((r=>{var n=$(r,1)[0];return t.tabs[e]=Object.assign({},a,n),t})):Promise.resolve(t)})),Ba=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_get_pinned_message",chat:e,gid:t.gid,hash:t.tabs[e].hash}).then((e=>{var r=$(e,1)[0];return a.pinned=r||null,t}))})),Ga=(0,T.wrapHashAction)((function(e,t,a){var n=a.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_get_message_local_id",chat:e,chat_local_id:t,hash:n.hash})})),ja=(0,T.wrapHashAction)((function(e,t){return Promise.all([ge(e,t),function(e,t){var a=t.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_get_chat_details",chat:e,gid:t.gid,hash:a.hash}).then((e=>{var r=$(e,1)[0];return a.photoGrid=r.grid,a.photoLarge=r.photo,a.membersLastSeen=r.lastSeen||null,a.inviters=r.inviters,a.caccess=r.caccess,a.invitedByMe=r.invitedByMe||[],a.inviteLinks=r.links||null,a.invitedByMessageRequest=r.invitedByMessageRequest,a.canRestore=r.canRestore,a.serverSettings=r.serverSettings||null,a.isDefaultPhotoOwner=r.isDefaultPhotoOwner||null,a.owner=r.owner||null,a.allowedUpdateFlags=r.allowedUpdateFlags,a.canInvite=r.canInvite||null,a.notifications=r.notifications,t}))}(e,t),(0,k.getCustomChatMemberSearch)(t,e)||Promise.resolve()]).then((()=>t))})),qa=(0,T.wrapHashAction)((function(e,t,a){var n=a.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_update_flags",chat:e,gid:a.gid,hash:n.hash,flags:t}).then((e=>(a.onUpdate&&a.onUpdate(),e)))})),Va=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return(0,r.post)("al_page.php",{act:"owner_photo_remove",oid:e,gid:t.gid,hash:a.photoHash}).then((()=>(a.photo=null,a.photoLarge=null,t.onUpdate&&t.onUpdate(),t)))}));function za(e,t,a,r){var n=r.tabs[e];return n.adminIds=a?[].concat(n.adminIds,t).filter(((e,t,a)=>a.indexOf(e)===t)):n.adminIds.filter((e=>e!==t)),Promise.resolve(r)}var Ya=(0,T.wrapHashAction)((function(e,t,a,n){var i=n.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_toggle_admin",chat:e,hash:i.hash,mid:t,is_admin:+a,gid:n.gid}).then((()=>za(e,t,a,n)))}));function $a(e,t,a,r){var n=(0,g.getMessage)(e,a,t).userId;return(0,p.oCacheGet)(r,n)?Promise.resolve(r):wt({[a]:[n]},r)}function Ka(){ajax.post("al_im.php",{act:"a_hide_promo_tooltip"})}var Wa=(0,T.wrapHashAction)((function(e,t){return t.tabs[e].top_banner=void 0,(0,r.post)(y.CONTROLLER,{act:"a_hide_banner",peer_id:e,gid:t.gid,hash:t.tabs[e].hash}).then((()=>t))})),Qa=(0,T.wrapHashAction)((function(e,t,a){a.tabs[e].top_banner=void 0;var n=a.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_callback_banner",peer_id:e,callback_data:t,hash:n.hash}).then((()=>a))}));function Ja(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_load_banner",peer_id:e,gid:t.gid}).then((a=>{var r=$(a,1)[0];return t.tabs[e].top_banner=r,t}))}function Xa(e,t,a){return a.tabs[e].keyboard=t&&t.buttons?t:null,er(e,!1,!0,a)}function Za(e,t){return Xa(e,null,t)}function er(e,t,a,r){return((r.tabs||{})[e]||{}).keyboard&&(r.tabs[e].keyboard.hide=t,a&&ls.set("is_keyboards_hide",Object.assign(ls.get("is_keyboards_hide")||{},{[e]:t}))),Promise.resolve(r)}var tr=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_get_keyboard",peer_id:e,hash:a.hash}).then((a=>{var r=$(a,1)[0];return Xa(e,r,t)}))}));function ar(e,t,a,n){var i=n.tabs[e];return i.caccess[t]=a,(0,r.post)(y.CONTROLLER,{act:"a_change_caccess",peer_id:e,member_id:t,hash:i.hash,access:a?1:0,gid:n.gid}).then((()=>n)).catch((e=>{throw i.caccess[t]=!a,e}))}var rr=(0,T.wrapHashAction)((function(e,t){var a=t.tabs[t.peer];return(0,r.post)(y.CONTROLLER,{act:"a_delete_template",template_id:e,hash:a.hash,gid:t.gid,peer_id:t.peer}).then((()=>{var a=t.templates.find((t=>t.id===e));return a&&(a.deleted=!0),t}))}));function nr(e,t,a){var n=a.tabs[a.peer];return(0,r.post)(y.CONTROLLER,{act:"a_create_template",hash:n.hash,gid:a.gid,peer_id:a.peer,name:e,text:t}).then((e=>(a.templates.unshift(e[0]),a)))}function ir(e,t,a,n){var i=n.tabs[n.peer];return(0,r.post)(y.CONTROLLER,{act:"a_update_template",template_id:e,hash:i.hash,gid:n.gid,peer_id:n.peer,group_id:n.gid,name:t,text:a}).then((t=>{var a=n.templates.find((t=>t.id===e));return a&&Object.assign(a,t[0]),n}))}function sr(e,t){if((0,d.isFullyLoadedTab)(t,e)){var a=(0,g.getTab)(t,e);a.allShown=!1,a.lastReset=Date.now()}return t}function or(e,t){var a=e.updateType,r=e.updateArg,n=0;a===i.MAIL_CHAT_UPDATE_TYPE_MESSAGE_REQUEST_CHANGED&&(n=r===i.MESSAGE_REQUEST_STATUS_NEW?1:-1),a===i.MAIL_CHAT_UPDATE_TYPE_CONTACT_CONVERTED&&(n=-1);var s=t.dialog_tab_cts[y.ConvoListFolder.MR];return s&&(s.total=(0,q.getConvoListFolderCounterDisplayed)(t,y.ConvoListFolder.MR)+n),Promise.resolve(t)}function lr(e,t,a){if((0,d.isFullyLoadedTab)(a,e.peerId)){var r=(0,g.getTab)(a,e.peerId);r.history=(0,d.setCasperMessageExpiringStatusDOM)(r.history,t,e.messageId)}return Promise.resolve(a)}function cr(e,t){return Promise.resolve().then((()=>{if((0,d.isFullyLoadedTab)(t,e)){var a=(0,g.getTab)(t,e);Object.values(a.msgs).forEach((e=>{var t=(0,g.parserMessage)(e);(0,m.isCasperMessage)(t)&&!E.casperMessagesStore.has(t.chat_local_id)&&E.casperMessagesStore.add(t)}))}return Promise.resolve(t)}))}var dr=(0,T.wrapHashAction)((function(e,t,a,n,i){return(0,r.post)(y.CONTROLLER,{act:"a_peer_profile_toggle_tag",hash:i.manage_tags_hash,group_id:i.gid,peer_id:n,tag_id:e,action:a}).then((a=>{i.tabs[n].peer_tags=a[0];var r=i.peer_profile_tags.findIndex((t=>t.id===e));return t?i.peer_profile_tags[r].uses++:!t&&i.peer_profile_tags[r].uses>0&&i.peer_profile_tags[r].uses--,i}))})),ur=(0,T.wrapHashAction)((function(e,t){return(0,r.post)(y.CONTROLLER,{act:"a_peer_profile_manage_tags",hash:t.manage_tags_hash,group_id:t.gid,tags:JSON.stringify(e)}).then((e=>(t.peer_profile_tags=e[0].tags,t)))})),_r=(0,T.wrapHashAction)((function(e,t,a){return(0,r.post)(y.CONTROLLER,{act:"a_peer_profile_save_note",hash:a.manage_tags_hash,group_id:a.gid,peer_id:e,note:t}).then((()=>(a.tabs[e].peer_profile_info.note=t,a)))})),gr=(0,T.wrapHashAction)(((e,t)=>(0,r.post)(y.CONTROLLER,{act:"a_reload_message",msg_id:e,hash:t.writeHash}).then((e=>$(e,1)[0])))),mr=(0,T.wrapHashAction)(((e,t)=>{var a=t.tabs[e];return(0,r.post)(y.CONTROLLER,{act:"a_get_active_call_data",peer_id:a.peerId,hash:a.hash}).then((e=>{var r=$(e,1)[0];return r?a.callInProgress=r:a.callInProgress&&delete a.callInProgress,t}))})),pr=(e,t)=>{var a=t.tabs[e];return a.callInProgress&&delete a.callInProgress,Promise.resolve(t)};function hr(e,t){return t.peer_tags_filter&&t.peer_tags_filter.ids!==e&&(0,P.resetFolderList)(t,y.ConvoListFolder.PEER_TAGS),t.peer_tags_filter={ids:e,mask:(0,w.convertPeerTagsFilterToMask)(t.peer_profile_tags,e)},Promise.resolve(t)}function fr(e,t,a,r){var n=(0,g.getTab)(r,e);if(n){var i,s,o=n.peer_tags?n.peer_tags.ids:[];if(n.peer_tags={ids:t,mask:a},t.length!==o.length)t.length>o.length?(i=!0,s=t.filter((e=>!o.includes(e)))[0]):(i=!1,s=o.filter((e=>!t.includes(e)))[0]),r=function(e,t,a){if(!a.peer_profile_tags)return a;var r=a.peer_profile_tags.find((t=>t.id===e));r&&(t?r.uses++:r.uses>0&&r.uses--);return a}(s,i,r)}return Promise.resolve(r)}function vr(e){return e.dialog_tabs[u.FOLDER_PEER_TAGS]=e.dialog_tabs[u.FOLDER_ALL].map((t=>(0,g.getTab)(e,t))).filter((t=>(0,w.applyPeerTagsFilterToTab)(e,t))).map((e=>e.peerId)),Promise.resolve(e)}function br(e){return(0,r.post)(y.CONTROLLER,{act:"a_get_peer_profile_tags",group_id:e.gid}).then((t=>(e.peer_profile_tags=t[0].tags,e.active_tab===u.FOLDER_PEER_TAGS?(e.peer_tags_filter.ids=e.peer_profile_tags.filter((t=>e.peer_tags_filter.ids.includes(t.id))).map((e=>e.id)),e.peer_tags_filter.mask=(0,w.convertPeerTagsFilterToMask)(e.peer_profile_tags,e.peer_tags_filter.ids),(0,n.updateLocation)({tab:u.FOLDER_PEER_TAGS,tags:e.peer_tags_filter.mask}),vr(e)):e)))}},412947:(e,t,a)=>{"use strict";a.d(t,{statlogsForwardEvent:()=>d,statlogsForwardFromCommunityEvent:()=>u,statlogsCommunityTemplatesClickEvent:()=>_,statlogsForwardFromChannel:()=>g,statlogsSendingTime:()=>p,statlogsSendingTimeStart:()=>h,statlogsSendingTimeEnd:()=>f,statlogsSendingError:()=>v,statlogsSendingQueueLength:()=>E,statlogsSendingRetry:()=>y});a(59357);var r=a(612202),n=a(171516),i=a(19331),s=a(414332),o=a(982452),l=new s.DevNullStatCollector(new s.CustomStatCollector),c={};function d(e){(0,r.statlogsProbValueEvent)(.1,"im_forward_stat",m(e),!!e.get().gid)}function u(e,t){(0,r.statlogsProbValueEvent)(.1,"im_forward_from_community_stat",m(e),!!e.get().gid,+t)}function _(){(0,r.statlogsProbValueEvent)(1,"im_apply_community_template_stat",1)}function g(){(0,r.statlogsProbValueEvent)(1,"messages_channel_forward_click",1)}function m(e){var t=e.get().pendingForward;return+(t&&t.msgIds&&t.msgIds.length)}function p(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1;if(!(0,i.randEnabled)(s))return()=>{};var o=+new Date,c=b(e),d=C(e)?"sse":"longpoll";return function(){var e=+new Date-o;(0,n.saveStatlogEvents)({name:"messages_send_time_web",value:e,keys:[t,a,c,r,d]}),"opt_to_lp"===a&&l.logEvent({key:"messages_send_time_web",value_str:d,value:e})}}function h(e,t,a,r){if(t.messageId&&-1!==String(t.messageId).indexOf("rid")){var n=[t.messageId.replace("rid",""),a,r].join("_"),i=t.attaches.length>0;c[n]=p(e,a,r,i)}}function f(e,t,a,r){var n=[t.randomId,a,r].join("_"),i=c[n];i&&(i(),delete c[n])}function v(e,t,a,n){var s=b(e),o=""===t?"network":"unknown";(0,i.randEnabled)(1)&&(0,r.statlogsValueEvent)("messages_send_errors_web",o,a,n,s)}function b(e){var t=(0,o.unpackStore)(e);return Boolean(t.longpoll&&t.longpoll.isEnabled&&t.longpoll.isEnabled())}function C(e){var t=(0,o.unpackStore)(e);return Boolean(t.longpoll&&t.longpoll.isSSE)}function E(e){var t=(0,o.unpackStore)(e),a=t.imQueue(t.peer).length;(0,i.randEnabled)(1)&&(0,r.statlogsValueEvent)("messages_send_queue_size",a)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown",a=1;(0,i.randEnabled)(a)&&(0,r.statlogsValueEvent)("messages_send_retry",1,t,e)}},868256:(e,t,a)=>{"use strict";a.d(t,{PeerProfile:()=>I});a(175115);var r=a(667294),n=(a(45697),a(104837)),i=a(483295),s=a(475632),o=a(495283),l=a(968958),c=a(786067),d=a(41650),u=a(416601),_=a(418793),g=a(897404),m=a(454593),p=a(253890),h=a(57647),f=a(262333),v=a(1795),b=a(105103),C=a(371351);function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},E.apply(this,arguments)}var y=d.default.getLang,T="peer_profile_modal";class I extends r.PureComponent{constructor(e){super(e),this.toggleProfile=()=>{this.setState({isCollapsed:!this.state.isCollapsed})},this.onPeerTagsChange=(e,t)=>{var a=this.props.store,r=a.get().peer;this.setState((a=>({peerTags:t?[].concat(a.peerTags,e):a.peerTags.filter((t=>t!==e))})),(()=>{a.set(m.peerProfileToggleTag.bind(null,e,t,t?"bind":"unbind",r)).catch((e=>(0,l.imWeirdCatch)("PeerProfile.toggleTag",e)))}))},this.onSave=e=>{this.setState({tags:e},(()=>{this.props.store.set(m.peerProfileManageTags.bind(null,[...this.state.tags])).then((e=>{var t=e.get().peer_profile_tags;this.setState({isCollapsed:0===t.length,tags:t,isTagsModalOpened:!1}),showDoneBox(y("mail_im_peer_profile_manage_tags_success"),{out:1e3})})).catch((e=>(0,l.imWeirdCatch)("PeerProfile.manageTags",e)))}))},this.onNoteSave=e=>{var t=this.props.store,a=t.get().peer;t.set(m.peerProfileSaveNote.bind(null,a,e)).then((()=>{this.setState({note:e,isNoteModalOpened:!1}),showDoneBox(y(e?"mail_im_peer_profile_save_note_success":"mail_im_peer_profile_delete_note_success"),{out:1e3})})).catch((e=>(0,l.imWeirdCatch)("PeerProfile.saveNote",e)))},this.toggleModal=(e,t,a)=>{switch(e&&e.preventDefault(),a){case"tags":this.setState({isTagsModalOpened:t});break;case"note":this.setState({isNoteModalOpened:t})}t&&(0,s.cancelStackPush)(T,(()=>{(0,s.cancelStackFilter)(T),this.toggleModal(null,!1,a)}))};var t=e.store.get(),a=t.peer,r=(0,n.getTab)(t,a),i=r.peer_profile_info||{};this.state={isCollapsed:!0,tags:t.peer_profile_tags||[],peerTags:r.peer_tags?r.peer_tags.ids:[],note:i.note,isTagsModalOpened:!1,isNoteModalOpened:!1}}render(){var e=this.props.store.get(),t=(0,n.getTab)(e,e.peer),a=this.state,s=a.isCollapsed,l=a.tags,d=a.peerTags,m=a.note,T=a.isTagsModalOpened,I=a.isNoteModalOpened,A=l.length>0,L=A?l.reduce(((e,t)=>(e[t.id]=!0,e)),{}):[],S=d.filter((e=>L[e])),k=t.peer_profile_info,M=k&&(k.city||k.age),N=(0,i.classNames)("PeerProfile__wrapper",{"PeerProfile__wrapper--collapsed":s});return r.createElement("div",{className:N},r.createElement(_.Scroll,{className:"PeerProfile__scroll",neverHide:!0},r.createElement("dl",{className:"PeerProfile__container"},r.createElement("dt",{className:"PeerProfile__label"},y("mail_im_peer_profile_tags_label_text")),r.createElement("dd",{className:"PeerProfile__content PeerProfile__tags"},s&&!A&&!t.ad_id&&r.createElement(u.default,{className:"PeerProfile__manageTagsLink",onClick:e=>this.toggleModal(e,!0,"tags")},y("mail_im_peer_profile_manage_tags")),(A||t.ad_id)&&r.createElement(p.PeerProfileTagsList,{tags:l,peerTags:S,isPeerProfileCollapsed:s,adId:t.ad_id,hasAdAccess:t.has_ad_access,isEasyPromotedMarket:t.is_easy_promoted_market,toggleProfile:this.toggleProfile}),!s&&r.createElement(h.PeerProfileTagsGrid,{tags:[...l].map((e=>E({},e,{isChecked:d.includes(e.id)}))),onPeerTagsChange:this.onPeerTagsChange}),!s&&r.createElement(u.default,{className:"PeerProfile__manageTagsLink",onClick:e=>this.toggleModal(e,!0,"tags")},y("mail_im_peer_profile_manage_tags")),T&&r.createElement(f.PeerProfileTagsModal,{tags:l,onSave:this.onSave,onClose:e=>this.toggleModal(e,!1,"tags")})),r.createElement("dt",{className:"PeerProfile__label"},y("mail_im_peer_profile_info_label_text")),r.createElement("dd",{className:"PeerProfile__content PeerProfile__info"},M&&r.createElement(r.Fragment,null,k.city&&r.createElement("span",{className:"PeerProfile__infoItem"},(0,o.decodeHTMLEntities)(k.city)),k.age&&r.createElement("span",{className:"PeerProfile__infoItem"},(0,o.decodeHTMLEntities)(k.age)),k.likes_cnt&&r.createElement(g.default,{className:"PeerProfile__infoTooltip",position:"t",text:y("mail_peer_profile_likes_replies_tooltip"),appearance:"light"},r.createElement("span",{className:"PeerProfile__infoItem"},k.likes_cnt&&r.createElement("span",{className:"PeerProfile__infoItem"},(0,o.decodeHTMLEntities)(k.likes_cnt)),k.replies_cnt&&r.createElement("span",{className:"PeerProfile__infoItem"},(0,o.decodeHTMLEntities)(k.replies_cnt))))),!M&&r.createElement("span",null,y("mail_im_peer_profile_info_empty"))),e.is_peer_profile_note_enabled&&r.createElement(r.Fragment,null,r.createElement("dt",{className:"PeerProfile__label"},y("mail_im_peer_profile_note_label_text")),r.createElement("dd",{className:"PeerProfile__content PeerProfile__note"},!m&&r.createElement(u.default,{onClick:e=>this.toggleModal(e,!0,"note")},y("mail_im_peer_profile_note_add_link")),!!m&&r.createElement(r.Fragment,null,r.createElement("span",{className:"PeerProfile__noteText"},(0,o.decodeHTMLEntities)(m)),r.createElement("span",{className:"PeerProfile__noteDivider"}," · "),r.createElement(u.default,{onClick:e=>this.toggleModal(e,!0,"note")},y("mail_im_peer_profile_note_edit_link"))),I&&r.createElement(v.PeerProfileNoteModal,{note:m,onNoteSave:this.onNoteSave,onClose:e=>this.toggleModal(e,!1,"note")}))),r.createElement("dt",{className:"PeerProfile__label"},y("mail_im_peer_profile_join_date_label_text")),r.createElement("dd",{className:"PeerProfile__content"},k&&k.join_date?(0,o.decodeHTMLEntities)(k.join_date):(0,c.langSex)(t.sex,y("mail_im_peer_profile_join_date_empty_text","raw"))))),(A||t.ad_id)&&r.createElement("button",{className:"PeerProfile__toggler",onClick:this.toggleProfile},this.state.isCollapsed?r.createElement(b.default,null):r.createElement(C.default,null)))}}},1795:(e,t,a)=>{"use strict";a.d(t,{PeerProfileNoteModal:()=>g});var r=a(667294),n=(a(45697),a(483295)),i=a(495283),s=a(41650),o=a(730365),l=a(288420),c=a(161650),d=a(273947),u=a(118690),_=s.default.getLang;class g extends r.Component{constructor(e){var t;super(e),t=this,this.onChange=e=>{var t=e.target.value;this.setState({note:t})},this.onSubmit=function(e){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&e.preventDefault();var r=t.state.note&&t.state.note.trim();a||r?(t.setState({isLoading:!0}),t.props.onNoteSave(r)):t.setState({note:""})},this.toggleConfirmationModal=(e,t)=>{e&&e.preventDefault(),this.setState({isConfirmationModalOpen:t})},this.state={note:e.note||"",isLoading:!1,isConfirmationBoxOpen:!1,isConfirmationModalOpen:!1},this.inputRef=r.createRef()}componentDidMount(){this.inputRef.current.element.focus()}render(){var e=(0,n.classNames)("PeerProfileNoteModal",{"PeerProfileNoteModal--hidden":this.state.isConfirmationModalOpen}),t=[...this.props.note?[r.createElement(l.default,{key:"delete",appearance:"link",onClick:e=>this.toggleConfirmationModal(e,!0),className:"PeerProfileNoteModal__deleteButton"},_("mail_im_peer_profile_note_delete_link"))]:[],r.createElement(l.default,{key:"cancel",appearance:"tertiary",onClick:this.props.onClose},_("global_cancel")),r.createElement(u.default,{key:"save",onClick:this.onSubmit,loading:this.state.isLoading},_("global_save"))];return r.createElement(r.Fragment,null,r.createElement(o.default,{onClose:this.props.onClose,className:e,disableBackdropClick:!0,disableEscapeClose:!0},r.createElement("form",{onSubmit:this.onSubmit},r.createElement(c.default.Header,{title:_("mail_im_peer_profile_note_box_title"),onClose:this.props.onClose,appearance:"blue"}),r.createElement(c.default.Body,null,r.createElement(d.default,{className:"PeerProfileNoteModal__input",value:(0,i.decodeHTMLEntities)(this.state.note),placeholder:_("mail_im_peer_profile_note_box_placeholder"),onChange:this.onChange,style:{height:21},maxLength:96,ref:this.inputRef})),r.createElement(c.default.Footer,{actionButtons:t}))),this.state.isConfirmationModalOpen&&r.createElement(c.default,{title:_("global_warning"),appearance:"blue",actionButtons:[r.createElement(l.default,{key:"cancel",appearance:"tertiary",onClick:e=>this.toggleConfirmationModal(e,!1)},_("global_cancel")),r.createElement(l.default,{key:"delete",onClick:e=>{this.toggleConfirmationModal(e,!1),this.setState({note:""},(()=>this.onSubmit(null,!0)))}},_("global_delete"))],onClose:e=>this.toggleConfirmationModal(e,!1),className:"PeerProfileConfirmationModal"},_("mail_im_peer_profile_note_delete_confirmation_text")))}}},57647:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsGrid:()=>i});var r=a(667294),n=(a(45697),a(941848));class i extends r.Component{constructor(){super(...arguments),this.onCheckboxChange=(e,t)=>{this.props.onPeerTagsChange(e,t)}}render(){var e=this.props.tags;return r.createElement("div",{className:"PeerProfileTagsGrid"},e.map(((e,t)=>r.createElement(n.PeerProfileTagsGridItem,{key:t,data:e,onCheckboxChange:this.onCheckboxChange}))))}}},941848:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsGridItem:()=>s});var r=a(667294),n=(a(45697),a(495283)),i=a(674041);function s(e){var t=e.data,a=e.onCheckboxChange,s=(0,n.decodeHTMLEntities)(t.name);return r.createElement("div",{className:"PeerProfileTagsGridItem",onClick:e=>{e&&e.preventDefault(),a(t.id,!t.isChecked)}},r.createElement(i.default,{className:"PeerProfileTagsGridItem__checkbox",checked:t.isChecked,onChange:(e,r)=>a(t.id,r)},r.createElement("span",{className:"PeerProfileTagsGridItem__color",style:{backgroundColor:t.color}}),r.createElement("span",{className:"PeerProfileTagsGridItem__name",title:s},s)))}},253890:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsList:()=>l});var r=a(667294),n=(a(45697),a(41650)),i=a(416601),s=a(663902),o=n.default.getLang;class l extends r.Component{constructor(e){super(e),this.onExtraClick=()=>{this.setState({isTagsCollapsed:!1})},this.state={isTagsCollapsed:!0}}render(){var e=this.props,t=e.peerTags,a=e.tags,n=e.isPeerProfileCollapsed,l=e.adId,c=e.hasAdAccess,d=e.isEasyPromotedMarket,u=e.toggleProfile,_=a.filter((e=>t.includes(e.id)));l&&_.unshift({adId:l,hasAdAccess:c,isEasyPromotedMarket:d});var g=0;n&&this.state.isTagsCollapsed&&_.length>5&&(g=_.splice(5).length);return _=_.map(((e,t)=>r.createElement(s.PeerProfileTagsListItem,{key:t,data:e}))),r.createElement("div",{className:"PeerProfileTagsList"},_.length>0&&_,g>0&&r.createElement("div",{className:"PeerProfileTagsListItem PeerProfileTagsListItem--extra",onClick:this.onExtraClick},`+ ${o("mail_im_peer_profile_extra_tags",g)}`),!_.length&&r.createElement("div",{className:"PeerProfileTagsListItem--empty"},o("mail_im_peer_profile_tags_empty")," ",r.createElement("span",{className:"PeerProfileTagsList__linkDivider"},"·")," ",r.createElement(i.default,{className:"PeerProfileTagsList__toggleProfileLink",onClick:u},o(n?"mail_im_peer_profile_toggle_tags_on":"mail_im_peer_profile_toggle_tags_off"))))}}},663902:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsListItem:()=>o});var r=a(667294),n=(a(45697),a(495283)),i=a(654612),s=a(41650).default.getLang;class o extends r.Component{constructor(){super(...arguments),this.onAdTagAlertClick=()=>{(0,i.showFastBox)(s("mail_ad_tag_no_access_box_title"),s("mail_ad_tag_no_access_box_text"))}}render(){var e=this.props.data;if(e.adId){var t=`ads?act=office&union_id=${e.adId}&utm_medium=community_messages_ad_tag&utm_source=dialog`,a="";a=e.isEasyPromotedMarket?s("mail_ad_tag_easy_promoted_market"):e.hasAdAccess?`${s("mail_ad_tag_text_prefix")} ${e.adId}`:s("mail_ad_tag_no_access_text");var i=r.createElement("span",{className:"PeerProfileTagsListItem__adTagText"},a);return r.createElement("div",{className:"PeerProfileTagsListItem PeerProfileTagsListItem--adTag"},e.hasAdAccess&&r.createElement("a",{className:"PeerProfileTagsListItem__adTagLink",href:t,target:"_blank"},i),!e.hasAdAccess&&r.createElement("button",{className:"PeerProfileTagsListItem__adTagAlert",onClick:this.onAdTagAlertClick},i))}return r.createElement("div",{className:"PeerProfileTagsListItem",style:{backgroundColor:e.color}},r.createElement("span",null,(0,n.decodeHTMLEntities)(e.name)))}}},262333:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsModal:()=>C});a(175115);var r=a(667294),n=(a(45697),a(483295)),i=a(495283),s=a(786067),o=a(41650),l=a(730365),c=a(288420),d=a(118690),u=a(416601),_=a(161650),g=a(418793),m=a(927111);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},p.apply(this,arguments)}var h=o.default.getLang,f=["#4bb34b","#5c9ce6","#e64646","#792ec0","#63b9ba","#ffa000","#ffc107","#76787a","#9e8d6b","#45678f","#539b9c","#454647","#7a6c4f","#6bc76b","#5181b8","#ff5c5c","#a162de","#7ececf","#aaaeb3","#bbaa84"],v=f[0],b="deleted";class C extends r.Component{constructor(e){var t;super(e),t=this,this.generateEmptyTag=()=>({name:"",color:this.state&&this.state.tags.length?this.getAvailableColor():v,state:"new"}),this.getAvailableColor=()=>{var e=[...this.state.tags].reduce(((e,t)=>(t.state!==b&&(e[t.color]=!0),e)),{});return f.find((t=>!e[t]))},this.onAddLinkClick=e=>{e&&e.preventDefault(),this.state.tags.filter((e=>e.state!==b)).length>=20||this.setState((e=>({tags:[...e.tags,this.generateEmptyTag()]})),(()=>{this.inputsRef.current.scrollIntoView({block:"end"})}))},this.onNameChange=(e,t)=>{var a=e.target.value;this.setState({tags:this.state.tags.map(((e,r)=>r===t?p({},e,{name:a,state:e.state||"changed"}):e))})},this.onRemove=function(e){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.state.tags,n=r[e];!a&&n.id&&n.uses>0?t.setState({isConfirmationModalOpen:!0,indexToRemove:e}):t.setState({tags:t.state.tags.filter(((t,a)=>a!==e)),deletedTags:[...t.state.deletedTags,p({},n,{state:b})]})},this.onSubmit=e=>{e&&e.preventDefault();var t=[...this.state.tags,...this.state.deletedTags].reduce(((e,t)=>(t.name.trim()&&t.state&&e.push({id:t.id,name:t.name,color:t.color,state:t.state}),e)),[]);this.setState({isLoading:!0}),this.props.onSave(t)},this.toggleConfirmationModal=(e,t)=>{e&&e.preventDefault(),this.setState({isConfirmationModalOpen:t})},this.state={tags:e.tags.length?e.tags.map((e=>p({},e))):[this.generateEmptyTag()],deletedTags:[],isLoading:!1,isConfirmationModalOpen:!1,indexToRemove:null},this.inputsRef=r.createRef()}render(){var e=this.state,t=e.tags,a=e.isConfirmationModalOpen,o=t[e.indexToRemove],p=(0,n.classNames)("PeerProfileTagsModal",{"PeerProfileTagsModal--hidden":a});return r.createElement(r.Fragment,null,r.createElement(l.default,{onClose:this.props.onClose,className:p,disableBackdropClick:!0,disableEscapeClose:!0},r.createElement("form",{onSubmit:this.onSubmit},r.createElement(_.default.Header,{title:h("mail_im_peer_profile_manage_tags_box_title"),onClose:this.props.onClose,appearance:"blue"}),r.createElement(_.default.Body,null,r.createElement(g.Scroll,{className:"PeerProfileTagsModal__scroll",neverHide:!0},r.createElement("div",{className:"PeerProfileTagsModal__tagsInputs",ref:this.inputsRef},this.state.tags.map(((e,t)=>r.createElement(m.PeerProfileTagsModalField,{index:t,key:t,data:e,onNameChange:this.onNameChange,onRemove:this.onRemove}))),this.state.tags.length<20?r.createElement(u.default,{className:"PeerProfileTagsModal__addLink",onClick:this.onAddLinkClick},h("mail_im_peer_profile_manage_tags_add_link")):""))),r.createElement(_.default.Footer,{actionButtons:[r.createElement(c.default,{key:"cancel",appearance:"tertiary",onClick:this.props.onClose},h("global_cancel")),r.createElement(d.default,{key:"save",onClick:this.onSubmit,loading:this.state.isLoading},h("global_save"))]}))),a&&r.createElement(_.default,{title:h("global_warning"),appearance:"blue",actionButtons:[r.createElement(c.default,{key:"cancel",appearance:"tertiary",onClick:e=>this.toggleConfirmationModal(e,!1)},h("global_cancel")),r.createElement(c.default,{key:"delete",onClick:e=>{this.toggleConfirmationModal(e,!1),this.onRemove(this.state.indexToRemove,!0)}},h("global_delete"))],onClose:e=>this.toggleConfirmationModal(e,!1),className:"PeerProfileConfirmationModal"},(0,s.langStr)(1===o.uses?h("mail_im_peer_profile_tag_delete_confirmation_text_single"):h("mail_im_peer_profile_tag_delete_confirmation_text",o.uses,!0),"tag_name",(0,i.decodeHTMLEntities)(o.name))))}}},927111:(e,t,a)=>{"use strict";a.d(t,{PeerProfileTagsModalField:()=>c});var r=a(667294),n=(a(45697),a(41650)),i=a(897404),s=a(495283),o=a(64107),l=n.default.getLang;class c extends r.Component{constructor(e){super(e),this.onKeyDown=e=>"Enter"!==e.key||(e.preventDefault(),!1),this.inputRef=r.createRef()}componentDidMount(){this.props.data.id||this.inputRef.current.focus()}render(){var e=this.props,t=e.index,a=e.data,n=e.onNameChange,c=e.onRemove;return r.createElement("div",{className:"PeerProfileTagsModalField"},r.createElement("input",{type:"hidden",value:a.id?a.id:""}),r.createElement("input",{type:"text",className:"PeerProfileTagsModalField__input",value:(0,s.decodeHTMLEntities)(a.name),ref:this.inputRef,onChange:e=>n(e,t),onKeyDown:this.onKeyDown,maxLength:20,placeholder:l("mail_im_peer_profile_manage_tags_placeholder")}),r.createElement("span",{className:"PeerProfileTagsModalField__color",style:{backgroundColor:a.color}}),r.createElement(i.default,{position:"t",text:l("mail_im_peer_profile_manage_tags_remove")},r.createElement("span",{className:"PeerProfileTagsModalField__remove",onClick:()=>c(t)},r.createElement(o.default,null))))}}},877947:(e,t,a)=>{"use strict";a.d(t,{mount:()=>g});a(530522),a(66108),a(296253),a(991181),a(579665),a(95767);var r=a(654612),n=a(454593),i=a(597903),s=a(610124),o=a(645523),l=a(850167),c=a(124041);function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function _(e){return e.parentNode.getAttribute("data-receiver-chat-peer-id")}function g(e,t,a){var u=(0,s.createModule)({handlers:(s,u)=>{u(e,"click","_im_join_chat",(e=>function(e,t){var a=domData(t,"chat-id"),i=domData(t,"hash"),s=domData(t,"chat-link");return c.FlatButton.lock(t),(0,n.joinChat)(a,i,s,e.get()).then((a=>{var r=d(a,1)[0];c.FlatButton.unlock(t);var n=e.get();n.longpoll.push([(0,o.changePeer)(r)]),n.onJoinChat&&n.onJoinChat(r)})).catch((e=>{(0,r.showFastBox)(getLang("mail_join_invite_error_title"),e),c.FlatButton.unlock(t)}))}(t,e.target))),u(e,"click","_im_accept_mr",(e=>function(e,t){var a=_(t);return c.FlatButton.lock(t),e.set(n.acceptMessageRequest.bind(null,a)).then((()=>{c.FlatButton.unlock(t),e.get().longpoll.push([(0,o.changePeer)(a,!1,!1,!1,"chat_preview")])})).catch((e=>{(0,i.hideAllBoxes)(),(0,r.showFastBox)(getLang("mail_join_invite_error_title"),e),c.FlatButton.unlock(t)}))}(t,e.target))),u(e,"click","_im_reject_mr",(e=>function(e,t,a){var s=_(a);return c.FlatButton.lock(a),e.set((e=>(0,n.rejectMessageRequest)(s,!1,e))).then((()=>{t.updateMenu(),t.updateList(),c.FlatButton.unlock(a),(0,i.hideAllBoxes)()})).catch((e=>{(0,i.hideAllBoxes)(),(0,r.showFastBox)(getLang("mail_error"),e),c.FlatButton.unlock(a)}))}(t,a,e.target))),u(e,"click","_im_join_chat_donut",(e=>function(e,t){var a=domData(t,"chat-id"),s=domData(t,"hash"),c=domData(t,"chat-link"),u=domData(t,"owner-id");(0,i.hideAllBoxes)(),(0,l.showDonutSubscribePopup)(null,null,u,"chat_preview","",{type:"subscribe",params:{act:"subscribe_popup"},onSuccessPayment:()=>{(0,n.joinChat)(a,s,c,e.get()).then((t=>{var a,r=d(t,1)[0],n=e.get();null===(a=n.longpoll)||void 0===a||a.push([(0,o.changePeer)(r)]),n.onJoinChat&&n.onJoinChat(r)})).catch((e=>{(0,r.showFastBox)(getLang("mail_join_invite_error_title"),e)}))}})}(t,e.target)))}});return{unmount(){(0,s.destroyModule)(u)}}}},329164:(e,t,a)=>{"use strict";a.d(t,{ImDraft:()=>l,loadDraftForPeer:()=>d});a(530522),a(66108),a(991181),a(579665),a(95767),a(751876),a(940851),a(296253),a(176774),a(59357);var r=a(887294),n=a(663825),i=a(454593);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function l(e,t){this._db=e,this._key=t,this.dData={txt:"",attaches:[],urlBinds:[],cancelled:[]},this.load()}function c(e){switch(e.type){case"mail":case"reply":return e.id<0&&1==e.object.fwd_count;default:return!e.object}}function d(e,t){return new l(e,"draft_"+t)}l.prototype.dump=function(){if(this._key){var e,t={txt:(e=this.dData).txt,attaches:e.attaches.length?e.attaches:void 0,urlBinds:e.urlBinds.length?e.urlBinds:void 0,cancelled:e.cancelled.length?e.cancelled:void 0},a=0===t.txt.length&&!t.attaches&&!t.urlBinds&&!t.cancelled;this._db.updateByKey(this._key,a?void 0:t)}},l.prototype.load=function(){if(this._key){var e=this._db.selectByKey(this._key);e&&(this.dData=function(e){return{txt:e.txt,attaches:e.attaches||[],urlBinds:e.urlBinds||[],cancelled:e.cancelled||[]}}(e))}},l.prototype.clear=function(){this.dData={txt:"",attaches:[],urlBinds:[],cancelled:[]},this.dump()},l.prototype.setText=function(e){this.dData.txt=trim(e),this.dump()},l.prototype.addAttach=function(e,t,a){if(("share"===e&&this.removeAttachByType(e),"mail"!==e&&"reply"!==e||(this.removeAttachByType("mail"),this.removeAttachByType("reply")),"audio_playlist"===e||"artist"===e)&&this.dData.attaches.find((t=>t.type===e)))return!1;if(!e||!t&&"poll"!==e)return!1;var r=this.dData.attaches.findIndex((a=>a.type===e&&a.id===t));-1===r?(this.dData.attaches.push({type:e,id:t,object:a}),this.dump()):"video"!==e&&"poll"!==e||(this.dData.attaches[r]={type:e,id:t,object:a},this.dump())},l.prototype.syncWithSelector=function(e){var t=this.getFwdRaw();this.dData.attaches=(t?[t]:[]).concat(e.getMedias().map((e=>{var t=s(e,2),a=t[0],r=t[1];return this.dData.attaches.find((e=>e.type==a&&e.id==r))||{type:a,id:r}}))),this.dump()},l.prototype.removeAttachByType=function(e){for(var t=this.dData.attaches.length;t--;)this.dData.attaches[t].type===e&&this.dData.attaches.splice(t,1);this.dump()},l.prototype.removeAllAttaches=function(){this.dData.attaches=[],this.dData.cancelled=[],this.dump()},l.prototype.addBindUrl=function(e,t,a){this.getBoundAttach(e)||(this.dData.urlBinds.push({url:e,type:t,id:a}),this.dump())},l.prototype.getBoundAttach=function(e){var t=this.dData.urlBinds.find((t=>t.url===e));return t&&this.dData.attaches.find((e=>e.type===t.type&&e.id===t.id))||null},l.prototype.getShareUrl=function(){var e=this.dData.attaches.find((e=>"share"===e.type));if(e&&e.object)return e.object.url.replace(/&amp;/g,"&")},l.prototype.hasOnlyReplies=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?e.flags&n.FLAG_HAS_REPLY&&!this.dData.attaches.find((e=>"mail"!==e.type)):this.hasAttaches()&&!this.dData.attaches.find((e=>"reply"!==e.type))},l.prototype.getCancelledShares=function(){return this.dData.cancelled.length?this.dData.cancelled:void 0},l.prototype.hasAttaches=function(){return this.dData.attaches.length>0},l.prototype.destroy=function(){this.dData={},this._key=this._db=null},l.prototype.prepareObjects=function(e,t){return this.dData.attaches.find(c)?(0,r.post)(i.CONTROLLER,{act:"draft_medias",gid:e,messageId:t||0,media:t?void 0:this.dData.attaches.map((e=>[e.type,e.id])).join("*")}).then((e=>{var t=s(e,1)[0];this.dData.attaches=t.map((e=>({type:e[0],id:e[1],object:e[2]})))})):Promise.resolve()},l.prototype.getFwdRaw=function(){return this.dData.attaches.find((e=>"mail"===e.type||"reply"===e.type))},l.prototype.getFwdCount=function(){var e=this.getFwdRaw();return e?e.id<0?e.object.fwd_count:e.id.split(";").length:0}},549892:(e,t,a)=>{"use strict";a.d(t,{oCacheExists:()=>r.oCacheExists,oCacheGet:()=>r.oCacheGet,oCacheAdd:()=>n.oCacheAdd});var r=a(606542),n=a(653004)},145470:(e,t,a)=>{"use strict";a.d(t,{getPeerProfileHeight:()=>c,mount:()=>u});var r=a(667294),n=a(973935),i=a(104837),s=a(597903),o=a(868256);function l(){return document.querySelector("#PeerProfile")}function c(){var e=l();return e?e.offsetHeight:0}function d(e,t){if(t){var a=parseInt(getStyle(e,"padding-top"));e.style.paddingTop=a+c()+"px"}else e.style.removeProperty("padding-top")}function u(e){return{render(t){var a=t.get(),c=l(),u=a.peer,_=(0,i.getTab)(a,u);a.is_peer_profile_enabled&&c&&(0,s.isFullyLoadedTab)(a,u)&&!(0,i.isChannelPeer)(_)&&!(0,i.isCommunityChat)(t,u)&&(c.innerHTML&&n.unmountComponentAtNode(c),n.render(r.createElement(o.PeerProfile,{store:t}),c,(()=>{d(e,!0)})))},destroy(){var t=l();t&&(n.unmountComponentAtNode(t),d(e,!1))}}}},342127:(e,t,a)=>{"use strict";a.d(t,{mount:()=>s});var r=a(610124),n=a(597903);function i(e){return{unmount(){(0,r.destroyModule)(e)}}}function s(e,t,a,s){var o=(0,r.createMutations)(i).bindMutations,l=t=>{a().messageKeyboardButtonClick(t),e.hide()};return o((0,r.createModule)({handlers:(t,a)=>{a(e.bodyNode,"click",n.MESSAGE_KEYBOARD_BUTTON_CLASS,l),a(e.bodyNode,"click",n.MESSAGE_ASR_COLLAPSE_TOGGLE_BUTTON,n.onASRCollapseToggleClick)}}))}},778755:(e,t,a)=>{"use strict";a.d(t,{isPinnedMessageVisibleInTab:()=>m,pinnedMessageHide:()=>p,pinnedMessageUnHide:()=>h,pinnedMessageUnpin:()=>f,mount:()=>y});var r=a(610124),n=a(454593),i=a(342127),s=a(597903),o=a(104837),l=a(982452),c=a(28238),d=a(376852),u=a(826338),_=a(459554),g="_im_pin_hide";function m(e,t){if((0,l.unpackStore)(e).searchShown)return!1;var a=(0,o.getTab)(e,t);return!!(a&&(0,u.isChatPeer)(t)&&a.pinned)&&!(0,_.isPinnedMessageHidden)(a)}function p(e,t,a){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=(0,o.getTab)(e,t),i=n&&(0,o.parserMessage)(n.pinned);n&&i&&(n.pinHideId=i.chat_local_id,cur.imDb.update(c.PIN_HIDDEN_ID_OP,[n.peerId,n.pinHideId]),b(a,t,e),re(geByClass1("_im_pinned_tt")),r&&window.Notifier&&Notifier.lcSend("pin_hide",{hide:1,peer:t}),statlogsValueEvent("im_pinned_messages","hide"))}function h(e,t,a){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=(0,o.getTab)(e,t);n&&n.pinHideId&&(delete n.pinHideId,cur.imDb.update(c.PIN_HIDDEN_ID_OP,[n.peerId,void 0]),b(a,t,e),r&&window.Notifier&&Notifier.lcSend("pin_hide",{hide:0,peer:t}),statlogsValueEvent("im_pinned_messages","show"))}function f(e,t,a){var r=b.bind(null,a,t),i=(0,s.showUnpinDialog)((()=>{i.hideProgress(),i.hide(),e.set(n.unpinMessageOptimistic.bind(null,t)).then(r).then((e=>e.set(n.unpinMessage.bind(null,t)))).then(r)}))}function v(e,t,a){var r=e.get().peer,n=(0,o.parserMessage)((0,o.getTab)(e,r).pinned);if(a.target.classList.contains(g))n&&p(e,r,t);else if("A"!==a.target.tagName){var l=n&&n.messageId;l&&!(0,s.isAlreadyDeleted)(e,r,l)?(0,s.focusOnMessage)(e,t().focusOnMessage,r,l):(0,s.showPinnedBox)(e,t,r,i.mount,a),statlogsValueEvent("im_pinned_messages","open")}}function b(e,t,a){return e().updateChatTopic(t,a),(0,n.setActions)(a.get()),e().updateActions(a),a}function C(e){(0,d.showTooltip)(e.target,{text:getLang("mail_hide_unpin_hover"),black:1,needLeft:1,shift:[8,4],forcetoup:!0,className:"_im_pinned_tt",appendEl:bodyNode})}function E(e){return{unmount(){(0,r.destroyModule)(e)}}}function y(e,t,a){var n=(0,r.createMutations)(E).bindMutations,i=v.bind(null,t,a),s=C.bind(null);return n((0,r.createModule)({handlers:(t,a)=>{a(e,"click","_im_pinned_message",i),a(e,"mouseover",g,s)}}))}},104837:(e,t,a)=>{"use strict";a.d(t,{isFullyLoadedTab:()=>u.isFullyLoadedTab,getTab:()=>u.getTabSafe,isTabMarkedUnread:()=>u.isTabMarkedUnread,isCommunityInterface:()=>_.isCommunityInterface,isReversedDialogs:()=>_.isReversedConvoOrder,isChannelPeer:()=>u.isChannelPeer,isCommunityPeer:()=>d.isCommunityPeer,isChatActive:()=>u.isChatActive,isCasperChatTab:()=>u.isCasperChatTab,parserMessage:()=>m.parseMessage,isClassicInterface:()=>_.isClassicInterface,isSearching:()=>_.isSearchView,getLocalId:()=>g.getLocalId,getFirstUnread:()=>v,isSearchShown:()=>b,getCurrentKeyboard:()=>C,getKeyboard:()=>E,getSelectedMessages:()=>y,getMessageRangeFromSelection:()=>T,countUnread:()=>I,getLastMessage:()=>A,getAuthorFullName:()=>L,getMessage:()=>S,isLocksAvailable:()=>k,isFoldersAvailable:()=>M,getBareTab:()=>N,makeTabNotFullyLoaded:()=>w,isGoToEndVisible:()=>P,isGoToMentionVisible:()=>O,getUnreadScrollBottom:()=>R,isSendingAvailable:()=>D,isCommunityBlocked:()=>F,checkVoiceMessageAvailable:()=>x,getSearchText:()=>H,isSearchingValue:()=>U,isRecentSearchesActive:()=>B,getPinnedMessage:()=>G,doPopularSuggExist:()=>j,isAnyMessageBeingEdited:()=>q,getGroupId:()=>V,getTabDraft:()=>z,getTemplates:()=>Y,tabIsMessageRequest:()=>$,tabIsRejectedMessageRequest:()=>K,tabIsMessageRequestToChat:()=>W,removeMessageRequestFolderFlags:()=>Q,isMessageRequestFolder:()=>J,tabIsOutgoingMessageRequest:()=>X,existsIncomingMessageRequest:()=>Z,isMessageRequestChangedEvent:()=>ee,isBusinessNotifyChangedEvent:()=>te,isCommunityChat:()=>ae,isCasperChat:()=>re});a(796409),a(820075),a(991181),a(296253);var r=a(294940),n=a(663825),i=a(254692),s=a(549892),o=a(329164),l=a(982452),c=a(145072),d=a(826338),u=a(459554),_=a(993421),g=a(376473),m=a(412827),p=a(179288),h=a(578843),f=a(19331);function v(e,t){var a=(0,l.unpackStore)(e),n=a.tabs[a.peer];return Object.keys(n.msgs).filter((a=>{var i=S(e,t,a);return(0,f.partConfigEnabled)("me_web_read_by_cmid")?!(0,r.isOut)(i)&&intval(i.chat_local_id)>n.in_up_to_cmid:!(0,r.isOut)(i)&&intval(a)>n.in_up_to}))[0]}function b(e){return(0,l.unpackStore)(e).searchShown}function C(e){return E(e,(0,_.getPeer)(e))}function E(e,t){var a=((0,u.getTabSafe)(e,t)||{}).keyboard;if(!a||!a.buttons||a.buttons.length)return a}function y(e){return(0,l.unpackStore)(e).selectedMessages}function T(e,t,a){var n=(0,u.getTabSafe)(e,t),i=y(e)[0];if(void 0===i)return[a];var s=Math.min(a,i),o=Math.max(a,i);return Object.keys(n.msgs).filter((e=>e>=s&&e<=o)).filter((t=>{var a=S(e,e.get().peer,t);return!(0,r.isServiceMsg)(a)&&!(0,r.isCallMessage)(a)})).map(intval)}function I(e,t){var a=(0,l.unpackStore)(t),n=(0,u.getTabSafe)(a,e),i=0;for(var s in n.msgs)if(n.msgs.hasOwnProperty(s)){var o=S(t,e,s);(0,r.isOut)(o)||(i+=(0,r.isUnread)(n,o)?1:0)}return i}function A(e,t,a){var r=(0,u.getTabSafe)(e,t),i=S(e,t,a),s=Object.keys(e.msg_local_ids_sort||{}).length>1?Object.values(r.msgs).sort(((t,a)=>{var r=(0,m.parseMessage)(t).messageId,n=(0,m.parseMessage)(a).messageId;return(0,g.getLocalId)(e,r)-(0,g.getLocalId)(e,n)})):Object.values(r.msgs);if(!i)return(0,m.parseMessage)(s[s.length-1]);for(var o=i.local,l=s.length-1;l>=0;l--){var c=(0,m.parseMessage)(s[l]),d=c.local&&c.type!==n.EDIT_MESSAGE;if(!(!o&&d))if(o&&!d||(0,g.getLocalId)(e,i.messageId)>(0,g.getLocalId)(e,c.messageId))return c}}function L(e,t,a){var n=(0,u.getTabSafe)(e,t),i=S(e,t,a),o=(0,l.unpackStore)(e);return(0,r.isOut)(i)?(0,s.oCacheGet)(e,o.id).name:i.userId!==i.peerId?!!(0,s.oCacheExists)(e,i.userId)&&(0,s.oCacheGet)(e,i.userId).name:n.tab}function S(e,t,a){var r=(0,u.getTabSafe)(e,t),n=r&&r.msgs&&r.msgs[a];return n?(0,m.parseMessage)(n):null}function k(e){return(0,l.unpackStore)(e).gid}function M(e){return(0,l.unpackStore)(e).gid}function N(e,t){var a=(0,l.unpackStore)(t);return a.tabs[e]||a.mapped_index[e]}function w(e,t){var a=(0,u.getTabSafe)(e,t);a&&(a.msgs=void 0,a.msgid=void 0,a.scrollTop=void 0,a.scrollBottom=void 0,a.contHeight=void 0,a.offset=void 0,a.skipped=void 0)}function P(e){var t=e.get().go_to_end_visible;return!!t&&t[0]}function O(e){var t=e.get().go_to_mentions_visible;return!!t&&t[0]}function R(e){var t=e.get().go_to_end_visible;return t?t[1]:0}function D(e){return!(0,l.unpackStore)(e).lockedSending}function F(e,t){return!!(0,d.isCommunityPeer)(t)&&!!(0,u.getTabSafe)(e,t).blocked_community}function x(e){return(0,l.unpackStore)(e).voice_message_available}function H(e){return(0,l.unpackStore)(e).searchText}function U(e,t){var a=(0,l.unpackStore)(e);return!!(t&&t!==H(e)||a.recentSearch)}function B(e){return(0,l.unpackStore)(e).recentSearch}function G(e){var t=(0,u.getCurrentTab)(e);return t&&t.pinned&&(0,m.parseMessage)(t.pinned)}function j(e){var t=e.get().popular_sugg;return t&&t.length>0}function q(e){return 1==(0,l.unpackStore)(e).isEditing}function V(e){return(0,l.unpackStore)(e).gid}function z(e){return e.draft||(e.draft=(0,o.loadDraftForPeer)(cur.imDb,e.peerId)),e.draft}function Y(e){return((0,l.unpackStore)(e).templates||[]).filter((e=>!e.deleted))}function $(e){return!!e&&(0,u.tabIsMessageRequest)(e)}function K(e){return Boolean(e.folders&i.FOLDER_MASKS[i.FOLDER_MESSAGE_REQUEST_REJECTED])}function W(e){return(0,d.isChatPeer)(e.peerId)&&$(e)}function Q(e){return e&~i.FOLDER_MASKS[i.FOLDER_MESSAGE_REQUEST]&~i.FOLDER_MASKS[i.FOLDER_MESSAGE_REQUEST_REJECTED]&~i.FOLDER_MASKS[p.FOLDER_NOT_IMPORTANT_MESSAGE_REQUEST]}function J(e){return(0,l.unpackStore)(e).active_tab===i.FOLDER_MESSAGE_REQUEST}function X(e){return e.peerId>19e8&&e.peerId<2e9}function Z(e){return!!(0,h.getConvoListFolderCounterTotal)(e,p.ConvoListFolder.MR)}function ee(e){var t=e.type,a=e.updateType;return t===n.CONVERSATION_UPDATED&&(a===n.MAIL_CHAT_UPDATE_TYPE_MESSAGE_REQUEST_CHANGED||a===n.MAIL_CHAT_UPDATE_TYPE_CONTACT_CONVERTED)}function te(e){var t=e.type,a=e.updateType;return t===n.CONVERSATION_UPDATED&&a===n.MAIL_CHAT_UPDATE_TYPE_BUSINESS_NOTIFY_DATA_CHANGED}function ae(e,t){var a=(0,u.getTabSafe)(e,t);return!!a&&(0,u.isCommunityChat)(a)}function re(e,t){return(0,u.doesChatTabHaveFlag)((0,u.getTabSafe)(e,t),c.MAIL_CHAT_FLAG_IS_CASPER)}},254692:(e,t,a)=>{"use strict";a.d(t,{FOLDER_UNREAD:()=>n.FOLDER_UNREAD,FOLDER_ALL:()=>n.FOLDER_ALL,FOLDER_UNRESPOND:()=>n.FOLDER_UNRESPOND,FOLDER_IMPORTANT:()=>n.FOLDER_IMPORTANT,FOLDER_MESSAGE_REQUEST:()=>n.FOLDER_MESSAGE_REQUEST,FOLDER_MESSAGE_REQUEST_REJECTED:()=>n.FOLDER_MESSAGE_REQUEST_REJECTED,FOLDER_MARKED_UNREAD:()=>n.FOLDER_MARKED_UNREAD,FOLDER_MASKS:()=>n.FOLDER_MASKS,FOLDER_PEER_TAGS:()=>n.FOLDER_PEER_TAGS,FOLDER_BUSINESS_NOTIFY:()=>n.FOLDER_BUSINESS_NOTIFY,MENTION:()=>n.MENTION,FOLDER_ARCHIVE:()=>n.FOLDER_ARCHIVE,OUR_DOMAINS:()=>l,ENTITIES:()=>c,VK_DOMAIN:()=>d,ARROW_UP:()=>u,ARROW_DOWN:()=>_,PAGE_UP:()=>g,PAGE_DOWN:()=>m,END_KEY:()=>p,HOME:()=>h,ENTER:()=>f,UNPRINTABLE_KEYS:()=>v,UP_DOWN_CONTROLS:()=>b,PRINTABLE:()=>C,TOP_DOMAINS:()=>E,MAX_DOMAIN_LENGTH:()=>y,EMAIL:()=>T,MESSAGE_REGEXP:()=>I,RE_HASHTAG_EXTRACTION_PATTERN:()=>k,LINE_FEED:()=>M});a(283946),a(59357);var r=a(961540),n=a(179288),i="((?:[\\w\\$А-Яа-яёЁєЄҐґЇїІіЈј\\—\\-\\_]+\\.){1,5})",s="([A-Za-zа-яА-Я\\-\\d]{2,22})",o=(0,r.getHostName)().replace(".","\\."),l=new RegExp(`^([a-zA-Z0-9\\.\\_\\-]+\\.)?(vkontakte\\.ru|${o}|vkadre\\.ru|vshtate\\.ru|userapi\\.com|vk\\.me)$`),c=/([^a-zA-Z0-9#%;_\-.\/?&=\[\]])/g,d=new RegExp(`^(?:https?:\\/\\/)?(?:${o}|vkontakte\\.ru)?\\/([a-zA-Z0-9\\._]+)\\??$`),u=38,_=40,g=33,m=34,p=35,h=36,f=13,v=[u,_,g,m,f,27,p,h],b=[g,m,_,u,h,p],C="printable",E=[].concat("aaa,aarp,abarth,abb,abbott,abbvie,abc,able,abogado,abudhabi,ac,academy,accenture,accountant,accountants,aco,active,actor,ad,adac,ads,adult,ae,aeg,aero,aetna,af,afamilycompany,afl,africa,ag,agakhan,agency,ai,aig,aigo,airbus,airforce,airtel,akdn,al,alfaromeo,alibaba,alipay,allfinanz,allstate,ally,alsace,alstom,am,americanexpress,americanfamily,amex,amfam,amica,amsterdam,an,analytics,android,anquan,anz,ao,aol,apartments,app,apple,aq,aquarelle,ar,aramco,archi,army,arpa,art,arte,as,asda,asia,associates,at,athleta,attorney,au,auction,audi,audible,audio,auspost,author,auto,autos,avianca,aw,aws,ax,axa,az,azure,ba,baby,baidu,banamex,bananarepublic,band,bank,bar,barcelona,barclaycard,barclays,barefoot,bargains,baseball,basketball,bauhaus,bayern,bb,bbc,bbt,bbva,bcg,bcn,bd,be,beats,beauty,beer,bentley,berlin,best,bestbuy,bet,bf,bg,bh,bharti,bi,bible,bid,bike,bing,bingo,bio,biz,bj,bl,black,blackfriday,blanco,blockbuster,blog,bloomberg,blue,bm,bms,bmw,bn,bnl,bnpparibas,bo,boats,boehringer,bofa,bom,bond,boo,book,booking,boots,bosch,bostik,boston,bot,boutique,box,bq,br,bradesco,bridgestone,broadway,broker,brother,brussels,bs,bt,budapest,bugatti,build,builders,business,buy,buzz,bv,bw,by,bz,bzh,ca,cab,cafe,cal,call,calvinklein,cam,camera,camp,cancerresearch,canon,capetown,capital,capitalone,car,caravan,cards,care,career,careers,cars,cartier,casa,case,caseih,cash,casino,cat,catering,catholic,cba,cbn,cbre,cbs,cc,cd,ceb,center,ceo,cern,cf,cfa,cfd,cg,ch,chanel,channel,chase,chat,cheap,chintai,chloe,christmas,chrome,chrysler,church,ci,cipriani,circle,cisco,citadel,citi,citic,city,cityeats,ck,cl,claims,cleaning,click,clinic,clinique,clothing,cloud,club,clubmed,cm,cn,co,coach,codes,coffee,college,cologne,com,comcast,commbank,community,company,compare,computer,comsec,condos,construction,consulting,contact,contractors,cooking,cookingchannel,cool,coop,corsica,country,coupon,coupons,courses,cr,credit,creditcard,creditunion,cricket,crown,crs,cruise,cruises,csc,cu,cuisinella,cv,cw,cx,cy,cymru,cyou,cz,dabur,dad,dance,data,date,dating,datsun,day,dclk,dds,de,deal,dealer,deals,degree,delivery,dell,deloitte,delta,democrat,dental,dentist,desi,design,dev,dhl,diamonds,diet,digital,direct,directory,discount,discover,dish,diy,dj,dk,dm,dnp,do,docs,doctor,dodge,dog,doha,domains,dot,download,drive,dtv,dubai,duck,dunlop,duns,dupont,durban,dvag,dvr,dz,earth,eat,ec,eco,edeka,edu,education,ee,eg,eh,email,emerck,energy,engineer,engineering,enterprises,epost,epson,equipment,er,ericsson,erni,es,esq,estate,esurance,et,eu,eurovision,eus,events,everbank,exchange,expert,exposed,express,extraspace,fage,fail,fairwinds,faith,family,fan,fans,farm,farmers,fashion,fast,fedex,feedback,ferrari,ferrero,fi,fiat,fidelity,fido,film,final,finance,financial,fire,firestone,firmdale,fish,fishing,fit,fitness,fj,fk,flickr,flights,flir,florist,flowers,fly,fm,fo,foo,food,foodnetwork,football,ford,forex,forsale,forum,foundation,fox,fr,free,fresenius,frl,frogans,frontdoor,frontier,ftr,fujitsu,fujixerox,fun,fund,furniture,futbol,fyi,ga,gal,gallery,gallo,gallup,game,games,gap,garden,gb,gbiz,gd,gdn,ge,gea,gent,genting,george,gf,gg,ggee,gh,gi,gift,gifts,gives,giving,gl,glade,glass,gle,global,globo,gm,gmail,gmbh,gmo,gmx,gn,godaddy,gold,goldpoint,golf,goo,goodhands,goodyear,goog,google,gop,got,gov,gp,gq,gr,grainger,graphics,gratis,green,gripe,group,gs,gt,gu,guardian,gucci,guge,guide,guitars,guru,gw,gy,hair,hamburg,hangout,haus,hbo,hdfc,hdfcbank,health,healthcare,help,helsinki,here,hermes,hgtv,hiphop,hisamitsu,hitachi,hiv,hk,hkt,hm,hn,hockey,holdings,holiday,homedepot,homegoods,homes,homesense,honda,honeywell,horse,hospital,host,hosting,hot,hoteles,hotmail,house,how,hr,hsbc,ht,htc,hu,hughes,hyatt,hyundai,ibm,icbc,ice,icu,id,ie,ieee,ifm,ikano,il,im,imamat,imdb,immo,immobilien,in,industries,infiniti,info,ing,ink,institute,insurance,insure,int,intel,international,intuit,investments,io,ipiranga,iq,ir,irish,is,iselect,ismaili,ist,istanbul,it,itau,itv,iveco,iwc,jaguar,java,jcb,jcp,je,jeep,jetzt,jewelry,jio,jlc,jll,jm,jmp,jnj,jo,jobs,joburg,jot,joy,jp,jpmorgan,jprs,juegos,juniper,kaufen,kddi,ke,kerryhotels,kerrylogistics,kerryproperties,kfh,kg,kh,ki,kia,kim,kinder,kindle,kitchen,kiwi,km,kn,koeln,komatsu,kosher,kp,kpmg,kpn,kr,krd,kred,kuokgroup,kw,ky,kyoto,kz,la,lacaixa,ladbrokes,lamborghini,lamer,lancaster,lancia,lancome,land,landrover,lanxess,lasalle,lat,latino,latrobe,law,lawyer,lb,lc,lds,lease,leclerc,lefrak,legal,lego,lexus,lgbt,li,liaison,lidl,life,lifeinsurance,lifestyle,lighting,like,lilly,limited,limo,lincoln,linde,link,lipsy,live,living,lixil,lk,loan,loans,local,locker,locus,loft,lol,london,lotte,lotto,love,lpl,lplfinancial,lr,ls,lt,ltd,ltda,lu,lundbeck,lupin,luxe,luxury,lv,ly,ma,macys,madrid,maif,maison,makeup,man,management,mango,market,marketing,markets,marriott,marshalls,maserati,mattel,mba,mc,mcd,mcdonalds,mckinsey,md,me,med,media,meet,melbourne,meme,memorial,men,menu,meo,metlife,mf,mg,mh,miami,microsoft,mil,mini,mint,mit,mitsubishi,mk,ml,mlb,mls,mm,mma,mn,mo,mobi,mobile,mobily,moda,moe,moi,mom,monash,money,monster,montblanc,mopar,mormon,mortgage,moscow,moto,motorcycles,mov,movie,movistar,mp,mq,mr,ms,msd,mt,mtn,mtpc,mtr,mu,museum,mutual,mv,mw,mx,my,mz,na,nab,nadex,nagoya,name,nationwide,natura,navy,nba,nc,ne,nec,net,netbank,netflix,network,neustar,new,newholland,news,next,nextdirect,nexus,nf,nfl,ng,ngo,nhk,ni,nico,nike,nikon,ninja,nissan,nissay,nl,no,nokia,northwesternmutual,norton,now,nowruz,nowtv,np,nr,nra,nrw,ntt,nu,nyc,nz,obi,observer,off,office,okinawa,olayan,olayangroup,oldnavy,ollo,om,omega,one,ong,onl,online,onyourside,ooo,open,oracle,orange,org,organic,orientexpress,origins,osaka,otsuka,ott,ovh,pa,page,pamperedchef,panasonic,panerai,paris,pars,partners,parts,party,passagens,pay,pccw,pe,pet,pf,pfizer,pg,ph,pharmacy,philips,phone,photo,photography,photos,physio,piaget,pics,pictet,pictures,pid,pin,ping,pink,pioneer,pizza,pk,pl,place,play,playstation,plumbing,plus,pm,pn,pnc,pohl,poker,politie,porn,post,pr,pramerica,praxi,press,prime,pro,prod,productions,prof,progressive,promo,properties,property,protection,pru,prudential,ps,pt,pub,pw,pwc,py,qa,qpon,quebec,quest,qvc,racing,radio,raid,re,read,realestate,realtor,realty,recipes,red,redstone,redumbrella,rehab,reise,reisen,reit,reliance,ren,rent,rentals,repair,report,republican,rest,restaurant,review,reviews,rexroth,rich,richardli,ricoh,rightathome,ril,rio,rip,rmit,ro,rocher,rocks,rodeo,rogers,room,rs,rsvp,ru,ruhr,run,rw,rwe,ryukyu,sa,saarland,safe,safety,sakura,sale,salon,samsclub,samsung,sandvik,sandvikcoromant,sanofi,sap,sapo,sarl,sas,save,saxo,sb,sbi,sbs,sc,sca,scb,schaeffler,schmidt,scholarships,school,schule,schwarz,science,scjohnson,scor,scot,sd,se,seat,secure,security,seek,select,sener,services,ses,seven,sew,sex,sexy,sfr,sg,sh,shangrila,sharp,shaw,shell,shia,shiksha,shoes,shop,shopping,shouji,show,showtime,shriram,si,silk,sina,singles,site,sj,sk,ski,skin,sky,skype,sl,sling,sm,smart,smile,sn,sncf,so,soccer,social,softbank,software,sohu,solar,solutions,song,sony,soy,space,spiegel,spot,spreadbetting,sr,srl,srt,ss,st,stada,staples,star,starhub,statebank,statefarm,statoil,stc,stcgroup,stockholm,storage,store,stream,studio,study,style,su,sucks,supplies,supply,support,surf,surgery,suzuki,sv,swatch,swiftcover,swiss,sx,sy,sydney,symantec,systems,sz,tab,taipei,talk,taobao,target,tatamotors,tatar,tattoo,tax,taxi,tc,tci,td,tdk,team,tech,technology,tel,telecity,telefonica,temasek,tennis,teva,tf,tg,th,thd,theater,theatre,tiaa,tickets,tienda,tiffany,tips,tires,tirol,tj,tjmaxx,tjx,tk,tkmaxx,tl,tm,tmall,tn,to,today,tokyo,tools,top,toray,toshiba,total,tours,town,toyota,toys,tp,tr,trade,trading,training,travel,travelchannel,travelers,travelersinsurance,trust,trv,tt,tube,tui,tunes,tushu,tv,tvs,tw,tz,ua,ubank,ubs,uconnect,ug,uk,um,unicom,university,uno,uol,ups,us,uy,uz,va,vacations,vana,vanguard,vc,ve,vegas,ventures,verisign,vermögensberater,vermögensberatung,versicherung,vet,vg,vi,viajes,video,vig,viking,villas,vin,vip,virgin,visa,vision,vista,vistaprint,viva,vivo,vlaanderen,vn,vodka,volkswagen,volvo,vote,voting,voto,voyage,vu,vuelos,wales,walmart,walter,wang,wanggou,warman,watch,watches,weather,weatherchannel,webcam,weber,website,wed,wedding,weibo,weir,wf,whoswho,wien,wiki,williamhill,win,windows,wine,winners,wme,wolterskluwer,woodside,work,works,world,wow,ws,wtc,wtf,xbox,xerox,xfinity,xihuan,xin,xperia,xxx,xyz,yachts,yahoo,yamaxun,yandex,ye,yodobashi,yoga,yokohama,you,youtube,yt,yu,yun,za,zappos,zara,zero,zip,zippo,zm,zone,zuerich,zw".split(","),"бг,бел,дети,ею,католик,ком,мкд,мон,москва,онлайн,орг,рус,рф,сайт,срб,укр".split(","),"qxam,90ae,90ais,d1acj3b,e1a4c,80aqecdr1a,j1aef,d1alf,l1acc,80adxhks,80asehdb,c1avg,p1acf,p1ai,80aswg,90a3ac,j1amh,80ao21a,y9a3aq,9dbq2a,mgbca7dzdo,mgba3a3ejt,mgbayh7gpa,lgbbat1ad8j,mgberp4a5d4ar,mgba7c0bbn0a,mgbc0a9azcg,mgb2ddes,mgbaam7a8h,mgba3a4f16a,mgbbh1a,mgbab2bd,ngbe9e0a,mgbbh1a71e,pgbs0dh,mgbpl2fh,ogbpf8fl,ngbc5azd,mgbtx2b,mgb9awbf,ygbi2ammx,wgbl6a,mgbi4ecexp,fhbei,wgbh1c,mgbx4cd0ab,mgbb9fbpob,4gbrim,mgbt3dhd,mgbai9azgqp6j,mgbgu82a,11b4c3d,c2br7g,h2brj9c,h2breg3eve,h2brj9c8c,i1b6b1a6a2e,54b7fta0cc,45brj9c,45br5cyl,s9brj9c,gecrj9c,3hcrj9c,xkc2dl3a5ee0h,xkc2al3hye2a,clchc0ea0b2g2a9gcd,fpcrj9c3d,2scrj9c,rvc1e0am3e,fzc2c9e2c,42c2d9a,o3cw4h,node,q9jyb4c,gckr3f0f,qcka1pmc,tckwe,cck2b3b,1ck2e1b,bck1b9a5dre4c,eckvdtc9d,rhqv96g,fiq64b,fiqs8s,fiqz9s,fiq228c5hs,vhquv,1qqw23a,vuq861b,nyqy26a,45q11c,55qx5d,55qw42g,kprw13d,kpry57d,czru2d,czrs0t,czr694b,w4rs40l,w4r85el8fhu5dnra,3ds443g,3oq18vl8pn36a,pssy2u,tiq49xqyj,fjq720a,fct429k,estv75g,xhq521b,9krt00a,30rr7y,6qq986b3xl,kput3i,kpu716f,zfr164b,mxtq1m,yfro4i67o,efvy88h,9et52u,rovu88b,nqv7f,b4w605ferd,unup4y,mix891f,mix082f,3pxu8k,pbt977c,6frz82g,nqv7fs00ema,ses554g,hxt814e,5tzm5g,io0a7i,8y0a063a,jlq61u9w7b,flw351e,g2xx48c,gk3at1e,3bst00m,fzys8d69uvgm,kcrx77d1x4a,jvr189m,imr513n,5su34j936bgsg,j6w193g,t60b56a,mk1bu44c,cg4bki,3e0b707e".split(",").map((e=>"xn--"+e))),y=E.reduce(((e,t)=>Math.max(e,t.length)),0),T=new RegExp("([a-zA-Zа-яА-Я\\-_\\.0-9\\+]+@("+i+s+"))","ig"),I=new RegExp("(https?:\\/\\/)?(((?:[\\w\\$А-Яа-яёЁєЄҐґЇїІіЈј\\—\\-\\_]+\\.){1,5})([A-Za-zа-яА-Я\\-\\d]{2,22})(?:\\:(\\d{2,5}))?)(([\\/?#])(?:\\&amp;|\\&#\\d{2,6};|,[_%]|!|,*[\\wА-Яа-я\\xa8\\xb8\\xc0-\\xffєЄҐґЇїІіЈј\\—\\-\\_@#%?+\\/\\$.~=;:'ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢄᢇ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ　-〿＀-￯*]+|(?:\\(|\\[)[\\w\\$А-Яа-яёЁєЄҐґЇїІіЈј\\d&#%;,]+(?:\\)|\\])){0,200})?","ig"),A="a-zA-Zа-яА-ЯёіјєїґўЁІЈЄЇҐЎ’",L="(?:&#(?:19[2-9]|(?:[2-9]|1[0-3])[0-9][0-9]);?)",S=`(?:[${A}_\\d]|${L})`,k=`(^|[s.,:'";>)(]?)(${`(#${S}{0,100}${`(?:[${A}]|${L})`}${S}{0,100})`})(@((?:[a-z0-9_]*[a-z0-9])?(?:(?:\\.[a-z](?:[a-z0-9_]+[a-z0-9])?)*\\.[a-z][a-z0-9_]{2,40}[a-z0-9])?))?(?=$|[s.,:'"&;?<)(]?)`,M=10},597903:(e,t,a)=>{"use strict";a.d(t,{getBareTab:()=>s.getBareTab,getTab:()=>s.getTab,isAnyMessageBeingEdited:()=>s.isAnyMessageBeingEdited,isClassicInterface:()=>s.isClassicInterface,isCommunityInterface:()=>s.isCommunityInterface,isCommunityPeer:()=>s.isCommunityPeer,isFoldersAvailable:()=>s.isFoldersAvailable,isFullyLoadedTab:()=>s.isFullyLoadedTab,isLocksAvailable:()=>s.isLocksAvailable,isReversedDialogs:()=>s.isReversedDialogs,isTabMarkedUnread:()=>s.isTabMarkedUnread,parserMessage:()=>s.parserMessage,tabIsMessageRequest:()=>s.tabIsMessageRequest,tabIsOutgoingMessageRequest:()=>s.tabIsOutgoingMessageRequest,tabIsRejectedMessageRequest:()=>s.tabIsRejectedMessageRequest,isLastMsgDebugEnabled:()=>f.isLastMsgDebugEnabled,showDebugAlert:()=>v.showDebugAlert,normalizeTabsGotFromServer:()=>C.normalizeTabsGotFromServer,isChatPeer:()=>c.isChatPeer,isUserPeer:()=>c.isUserPeer,isReservedPeer:()=>c.isReservedPeer,isContactPeer:()=>c.isContactPeer,getUserInitials:()=>y.getUserInitials,prepareContactName:()=>y.prepareContactName,replaceSpecialSymbols:()=>T.replaceSpecialSymbols,SENDING_CLASS:()=>I.SENDING_CLASS,FAILED_CLASS:()=>I.FAILED_CLASS,secondsToHuman:()=>T.secondsToHuman,RESTORE_CLASS:()=>Q,TYPING_CLASS:()=>J,MESSAGE_KEYBOARD_BUTTON_CLASS:()=>X,MESSAGE_STACK_CLASS:()=>Z,BOT_CAROUSEL_CLASS:()=>ee,CREATE_CHAT_ACTION:()=>te,CHAT_TITLE_ACTION:()=>ae,CHAT_INVITE_USER:()=>ne,CHAT_KICK_USER:()=>ie,CHAT_PHOTO_UPDATE:()=>oe,CHAT_PHOTO_REMOVE:()=>le,CHAT_PIN_MESSAGE:()=>ce,CHAT_UNPIN_MESSAGE:()=>de,CHAT_INVITE_BY_LINK:()=>ue,CHAT_SCREENSHOT:()=>_e,CHAT_GROUP_CALL_STARTED:()=>me,CHAT_KICK_USER_CALL_BLOCK:()=>pe,CHAT_KICK_DON:()=>he,DESELECT_ALL_CLASS:()=>fe,HIDE_TOP_NOTICE_CLASS:()=>ve,HIDE_ASIDE_NOTICE_CLASS:()=>be,HIDE_ASIDE_PROMO_BLOCK_CLASS:()=>Ce,INSTALL_VKADMIN_LINK:()=>Ee,CLEAR_RECENT_CLASS:()=>ye,TOGGLE_MR_TAB:()=>Te,TOGGLE_BUSINESS_NOTIFY_TAB:()=>Ie,TOGGLE_ARCHIVES_TAB:()=>Ae,TOGGLE_ALL_TAB:()=>Le,MESSAGE_SEARCH_CLASS:()=>Se,PINNED_CONTAINER_CLASS:()=>ke,AUDIO_MSG_CLASS:()=>Me,MESSAGE_ASR_COLLAPSE_TOGGLE_BUTTON:()=>Ne,getClassicChatHeight:()=>De,setClassicChatHeight:()=>Fe,applyInnerHtml:()=>xe,compensateHistoryHeightChange:()=>He,isAlreadyDeleted:()=>Ue,replaceMessageAttrs:()=>Be,isVoiceMessageAvailable:()=>Ge,getAvailableMicrophones:()=>je,dayFromVal:()=>qe,formatPhoneNumber:()=>Ve,updateMessageInCache:()=>ze,updateListenedMark:()=>Ye,editAndReplaceMessage:()=>$e,setCasperMessageExpiringStatusDOM:()=>Ke,markMessagesAsRead:()=>We,replaceAttaches:()=>Qe,replaceCarousel:()=>Je,MSG_NEW:()=>Xe,MSG_DUPLICATE:()=>Ze,MSG_LOCAL_DUPLICATE:()=>et,getMessageStoreStatus:()=>tt,isPeerActive:()=>at,isFvkcomgroup:()=>rt,isTabLoaded:()=>nt,isTabLoadedWithMessage:()=>it,convertPeerToUrl:()=>st,unUrlPeer:()=>ot,simplifyCounter:()=>lt,renderPhotosFromTab:()=>_t,renderBtnSearchOnlyMessages:()=>gt,renderMessagesSep:()=>mt,renderConversationsSep:()=>pt,renderPopularSuggSep:()=>ht,renderClearRecent:()=>ft,renderPopularSuggestions:()=>vt,renderConvoRecommendList:()=>bt,renderFindFriendsStub:()=>Ct,convertLegacyOnlineToAPIFlags:()=>Et,isViewWithRecommendations:()=>yt,setMessageError:()=>Tt,startResendMessage:()=>It,removeMessages:()=>At,removeExpiredMessagesStub:()=>Lt,removeStartingFromMessage:()=>St,removeMessagesWithRestore:()=>kt,restoreMessage:()=>Mt,formatTyper:()=>Nt,loadSummaryActivityType:()=>wt,renderEmptySearch:()=>Ot,addChatPhotoToUpdate:()=>Rt,isSelfMessage:()=>Dt,showVerifiedTooltip:()=>Ft,wrapLoading:()=>xt,tabFromIds:()=>Ht,checkSelectClick:()=>Ut,renderGoTo:()=>Bt,showFlushChat:()=>Gt,showLeaveDialog:()=>jt,showUnpinDialog:()=>qt,showMsgDeleteDialog:()=>Vt,cleanHistory:()=>zt,inviteUser:()=>Yt,toggleDialogsFolder:()=>$t,showUnreadOnly:()=>Kt,changeTab:()=>Wt,isImportant:()=>Qt,isUnrespond:()=>Jt,isPeerBlocked:()=>Xt,isPendingForward:()=>Zt,isPeerBlockedByMe:()=>ea,blockLatencyCompensation:()=>ta,showSpamLayer:()=>aa,getLastSeenTextInHeader:()=>ra,getLastSeenText:()=>na,showBlacklistBoxUser:()=>sa,showBlacklistBox:()=>oa,getBaseLink:()=>la,showFavvedBox:()=>ca,isEditableFocused:()=>da,updateStar:()=>ua,isMessagesVisible:()=>_a,hideTopNotice:()=>ga,hideAsideNotice:()=>ma,hideAsidePromoBlock:()=>pa,installVKAdminApp:()=>ha,renderShortText:()=>va,lockButton:()=>Ca,unlockButton:()=>Ea,renderPinnedMessage:()=>ya,showMessageInfoTooltip:()=>Ta,showEditTimeTooltip:()=>Ia,showCasperExpiringTooltip:()=>Aa,getHistoryTopIndent:()=>La,getPinnedMessageHeight:()=>Sa,applyMessageHandlers:()=>ka,showPinnedBox:()=>Ma,showRepliedBox:()=>Na,isUserAliveInChat:()=>wa,getAliveMembersCount:()=>Pa,splitMessageToParts:()=>Oa,isMessageTooLong:()=>Ra,showInvitationBox:()=>Da,showWaitUntilUploadedBox:()=>xa,canMessageBeDeletedForAll:()=>Ha,getChatMembersByIds:()=>Ua,formatTimespan:()=>Ba,focusOnMessage:()=>Ga,getNowEditingMessage:()=>ja,checkMessageRequestsTab:()=>qa,hideAllBoxes:()=>Va,getMessageRequestDateText:()=>za,canPinMessage:()=>Ya,canForwardMessages:()=>$a,canMarkImportant:()=>Ka,removeExpiredMessageIfNeed:()=>Wa,isPeerCurrentUser:()=>Qa,isGiftOptionAvailableForPeer:()=>Ja,isMoneyOptionAvailableForPeer:()=>Xa,replaceExpiredMessageWithPlaceholder:()=>Za,replaceExpiredRepliedMessageWithPlaceholder:()=>ar,getChatMemberCount:()=>rr,CALL_ENTRY_POINT_SNIPPET:()=>nr,CALL_ENTRY_POINT_HEADER:()=>ir,CALL_ENTRY_POINT_LIST:()=>sr,CALL_ENTRY_POINT_JOIN_SNIPPET:()=>or,CALL_ENTRY_POINT_JOIN_HEADER:()=>lr,CALL_ENTRY_POINT_JOIN_BANNER:()=>cr,CALL_ENTRY_POINT_WIDGET:()=>dr,startCallFromIm:()=>ur,handleCallLinkClick:()=>_r,isCallToPeerAvailable:()=>gr,joinCallFromIm:()=>mr,getConvoLocation:()=>pr,showGroupCallsOnboardingBox:()=>hr,showGroupCallsNewYearTooltip:()=>fr,getRightMenuMaxItems:()=>vr,showChatInvitationBox:()=>br,setCallbackButtonLoadingState:()=>Cr,getCallbackButton:()=>Er,onASRCollapseToggleClick:()=>yr});a(579665),a(95767),a(530522),a(175115),a(820075),a(991181),a(66108),a(59357),a(21466),a(751876),a(940851),a(296253);var r=a(663825),n=a(254692),i=a(283303),s=a(104837),o=a(294940),l=a(722088),c=a(826338),d=a(483295),u=a(376852),_=a(654612),g=a(49535),m=a(877947),p=a(363035),h=a(645523),f=a(993421),v=a(294378),b=a(179288),C=a(923876),E=a(58042),y=a(222131),T=a(442347),I=a(163612),A=a(982452),L=a(549892),S=a(778755),k=a(454593),M=a(968958),N=a(145072),w=a(695724),P=a(33649),O=a(266372),R=a(582744),D=a(145470),F=a(315544),x=a(786067),H=a(459554),U=a(854778),B=a(884137),G=a(19331),j=a(550220),q=a(578843),V=a(419672),z=a(917791);function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Y.apply(this,arguments)}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return K(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var W="_im_mess_original",Q="_im_mess_restore",J="_im_typing",X="_im_mess_btn",Z="_im_mess_stack",ee="_im_bot_carousel",te="chat_create",ae="chat_title_update",ne="chat_invite_user",ie="chat_kick_user",oe="chat_photo_update",le="chat_photo_remove",ce="chat_pin_message",de="chat_unpin_message",ue="chat_invite_user_by_link",_e="chat_screenshot",me="chat_group_call_started",pe="chat_kick_user_call_block",he="chat_kick_don",fe="_im_deselect_all",ve="_im_top_notice_hide",be="_im_aside_notice_hide",Ce="_im_aside_promo_block_hide",Ee="_im_vkadmin_promo_link",ye="_im_clear_recent",Te="_im_toggle_mr_tab",Ie="_im_toggle_business_notify_tab",Ae="_im_toggle_archives_tab",Le="_im_toggle_all_tab",Se="_im_mess_search",ke="_im_pinned",Me="im_msg_audiomsg",Ne="_msg_asr_collapse_toggle",we="._im_mess_stack",Pe=4096,Oe=100,Re="chatPosition";function De(){return ls.get(Re)||0}function Fe(e){e>=window.clientHeight()-30&&(e=0),ls.set(Re,e)}function xe(e,t){e&&e.innerHTML!==t&&(e.innerHTML=t)}function He(e,t,a,r){var n=t&&!a?1:!t&&a?-1:0;n&&!(0,s.isClassicInterface)(e)&&r().compensateHistoryHeightChange(n)}function Ue(e,t,a){var r=e.get?e.get():e;if(nt(r,t)){var n=r.tabs[t].deleted||[];return inArray(a,n)}return!1}function Be(e,t,a){var r=a.randomId,n=geByClass1(`_im_mess_rid${r}`,t);return n&&(t=(0,V.removeMessagesWithStack)([n],t),t=(0,V.appendMessageToHistory)(e,a,t,!1)),t}function Ge(e){var t=(0,s.checkVoiceMessageAvailable)(e);return(0,s.isCommunityInterface)(e)||browser.mobile&&browser.safari?Promise.resolve(!1):void 0!==t?Promise.resolve(t):je().then((e=>e.length>0)).catch((e=>!1))}function je(){return window.AudioContext&&navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(e){for(var t=[],a=0;a<e.length;a++)"audioinput"==e[a].kind&&t.push(e[a]);return t})):Promise.reject(new Error("NotSupported"))}function qe(e){var t=e.split(".");return(t[0]<10?"0":"")+t[0]+(t[1]<10?"0":"")+t[1]+t[2]}function Ve(e){var t=(""+e).replace(/\D/g,"").match(/^(\d+)(\d{3})(\d{3})(\d{2})(\d{2})$/);return t?`+${t[1]} (${t[2]}) ${t[3]}-${t[4]}-${t[5]}`:""}function ze(e,t,a){var r=domData(a,"msgid"),n=geByClass1(`_im_mess_${r}`,t),i=a.cloneNode(!0);return n&&(n.parentNode.replaceChild(i,n),(0,V.ensureDomHasActions)(t)),t}function Ye(e,t){var a=e.querySelector(`._im_mess_${t}`),r=null==a?void 0:a.querySelector(".im_msg_audiomsg");if(r)return r.classList.remove("im_msg_audiomsg--unlistened"),e}function $e(e,t,a){var r=geByClass1(`_im_mess_${t.messageId}`,a);if(r){var n=se((0,I.renderMessage)(e,t));r.classList.contains("im-mess_is_editing")&&n.classList.add("im-mess_is_editing"),r.parentNode.replaceChild(n,r),(0,V.ensureDomHasActions)(a)}return a}function Ke(e,t,a){var r=geByClass1(`_im_mess_${a}`,e);if(r){var n=r.closest(we),i=n&&n.querySelector(".im-mess-stack--bomb");i&&i.classList.add(t?"im-mess-stack--bomb_expiring-soon":"im-mess-stack--bomb_expiring")}return e}function We(e,t,a){var r=e.tabs[t];return(0,A.toArray)(geByClass("_im_mess_unread",a)).forEach((e=>{var t,a=!1;if((0,G.partConfigEnabled)("me_web_read_by_cmid")){var n=intval(domData(e,"cmid"));if(!n)return;a=r.out_up_to_cmid>=n}else{var i=intval(domData(e,"msgid"));if(!i)return;a=r.out_up_to>=i}a&&(removeClass(e,"_im_mess_unread"),removeClass(e,"im-mess_unread"),(t=geByClass1("_im_mess_blind_unread_marker",e))&&(t.removeAttribute("aria-label"),t.removeAttribute("role"),t.removeAttribute("tabindex")))})),a}function Qe(e,t,a){var r=t.peerId,n=t.messageId,i=geByClass1("_im_msg_reply"+n,e),s=geByClass1("_im_msg_media"+n,e),o=a.tabs[r].mediacontent[n][0];return i&&(i.innerHTML=o[0]),s&&(s.innerHTML=o[1]),e}function Je(e,t,a){var r=t.messageId,n=e.querySelector("._im_bot_carousel_"+r);if(n){var i=function(e,t){var a=(0,s.getMessage)(e,t.peerId,t.messageId).kludges.template,r=!1;if(!a)return"";var n=a.elements.reduce(((e,a,n)=>{var i="",s="",o=(0,w.clean)(a.title),l=(0,w.clean)(a.description);if(a.photo&&(i+=(0,w.getTemplate)("sImBotCarouselSlidePhoto",{url:a.photo.sizes.find((e=>"q"===e.type)).url,alt:o||l||""}),r=!0),o&&(s+=(0,w.getTemplate)("sImBotCarouselSlideTitle",{content:o})),l&&(s+=(0,w.getTemplate)("sImBotCarouselSlideDescription",{content:l})),(a.title||a.description)&&(i+=(0,w.getTemplate)("sImBotCarouselSlideContent",{content:s})),a.action&&("open_link"===a.action.type&&(i=(0,w.getTemplate)("sImBotCarouselSlideLinkWrapper",{content:i,url:(0,B.wrapAwayIfExternal)(a.action.link,!0)})),"open_photo"===a.action.type&&(i=(0,w.getTemplate)("sImBotCarouselSlidePhotoLinkWrapper",{content:i,photo_id:`${a.photo.owner_id}_${a.photo.id}`,msg_id:t.messageId}))),a.buttons){var c=a.buttons.reduce(((e,t,a)=>{var r=Number(n+""+a);return e+(0,w.getTemplate)("sImBotCarouselSlideButton",{label:(0,O.getButtonLabel)(t),appearance:(0,O.getButtonAppearance)(t),modifier:t.action.type.replace("_","-"),attributes:(0,O.getAttributesFromActionObject)(t.action,r),tag_name:"open_link"===t.action.type?"a":"button"})}),"");i+=(0,w.getTemplate)("sImBotCarouselSlideButtons",{content:c})}return e+(0,w.getTemplate)("sImBotCarouselSlide",{content:i,index:n})}),"");return a.elements.length>1?(0,w.getTemplate)("sImBotCarousel",{content:(0,w.getTemplate)("sImCarousel",{content:n,controls_class:r?"BotCarousel__control--fourth":"BotCarousel__control",scroll_count:"1"}),msg_id:t.messageId}):(0,w.getTemplate)("sImBotCarousel",{content:n,msg_id:t.messageId})}(a,t);return domReplaceEl(n,i),e}}var Xe=0,Ze=1,et=2;function tt(e,t){if(!(0,s.isFullyLoadedTab)(t,e.peerId))return Xe;var a=t.tabs[e.peerId];return a.msgs[e.messageId]?Ze:a.msgs["rid"+e.randomId]?et:Xe}function at(e,t){return e===t.peer}function rt(e,t){return(0,H.doesChatTabHaveFlag)((0,s.getTab)(e,t),1024)}function nt(e,t){return!!e.tabs[t]}function it(e,t){return!!nt(e,t)&&null!==e.tabs[t].lastmsg}function st(e){return(0,c.isChatPeer)(e)?"c"+(e-2e9):(0,c.isEmailPeer)(e)?"e"+Math.abs(e+2e9):(0,c.isContactPeer)(e)?"mr"+(e-19e8):e}function ot(e){switch(e.slice(0,1)){case"e":return-2e9-intval(e.slice(1));case"c":return 2e9+intval(e.slice(1));default:return intval(e)}}function lt(e){return e>9999999?Math.floor(e/1e6)+"M":e>9999?Math.floor(e/1e3)+"K":e>0?e.toString():""}function ct(e,t){var a=`<img src="${e}" alt="" class="dialogs_inline_chatter dialogs_inline_chatter_half"/>`;return t&&(a=(0,w.getTemplate)("im_dialogs_link",{href:t,photo:a})),`<div class="im_grid">\n    <div class="dialogs_inline_chatter dialogs_inline_chatter_half">\n      ${a}\n    </div>\n  </div>`}function dt(e,t){var a=`<img src="${e}" alt="" class="dialogs_inline_chatter"/>`;return t&&(a=(0,w.getTemplate)("im_dialogs_link",{href:t,photo:a})),`<div class="im_grid">\n    <div class="dialogs_inline_chatter">\n      ${a}\n    </div>\n  </div>`}function ut(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("string"==typeof e)return(0,w.getTemplate)("sImDialogImRowPhoto",{photo:`<img src="${e}" alt=""/>`});switch(e.length){case 1:return(0,w.getTemplate)("sImDialogImRowPhoto",{photo:`<img src="${e[0]}" alt=""/>`});case 2:return e.map(((e,a)=>ct(e,t[a]))).join("");case 3:return ct(e[0],t[0])+e.slice(1).map(((e,a)=>dt(e,t[a+1]))).join("");case 4:return e.map(((e,a)=>dt(e,t[a]))).join("")}}function _t(e,t,a){return(0,C.isDialogWithYourself)(e.get().id,t.peerId)?(0,w.getTemplate)("sImDialogImRowPhoto",{photo:`<img src="${b.FAVORITES_ICON_URL}" alt="">`}):"string"==typeof t.photo&&t.photo?(0,w.getTemplate)("sImDialogImRowPhoto",{photo:`<img src="${t.photo}" alt="">${t.photo_icon||""}`}):(0,c.isChatPeer)(t.peerId)&&t.membersCount<2?(0,w.getTemplate)("sImDialogImRowPhoto",{photo:`<img src="${e.get().default_chat_photo}" alt="">`}):Array.isArray(t.photo)?ut(t.photo):(0,c.isContactPeer)(t.peerId)?(0,w.getTemplate)("sImContactAvatar",{name:(0,y.getUserInitials)(t.tab),size:30,classes:"nim-peer--contact-avatar"}):ut(...(0,C.getDataForChatMemberGrid)(e,t,a))}function gt(e){var t=e.get().gid?(0,x.getLang)("mail_search_only_messages_comm"):(0,x.getLang)("mail_search_only_messages");return`<li class="im-page--mess-search-w">\n    <div class="im-page--mess-search ${Se}">\n      <button type="button" class="im-i--messages-search"></button>${t}\n    </div>\n  </li>`}function mt(){return`<li class="im-search-results-head">${(0,x.getLang)("mail_search_messages")}</li>`}function pt(){return`<li class="im-search-results-head">${(0,x.getLang)("mail_search_conversations_sep")}</li>`}function ht(){return`<li class="im-search-results-head">${(0,x.getLang)("mail_search_dialogs_sep")}</li>`}function ft(){return`<li class="im-search-results-head _im_recent_bar">\n    ${(0,x.getLang)("mail_recent_searches")}\n    <button type="button" class="${ye} im-page--clear-recent">${(0,x.getLang)("mail_clear_recent")}</button>\n  </li>`}function vt(e){var t=e.get().popular_sugg,a=(0,s.isClassicInterface)(e)?7:4;return t.length>a&&(t=t.slice(0,a)),'<li class="im-popular clear_fix">'+t.map((t=>{var a=t.peerId,r=!(0,C.isDialogWithYourself)(e.get().id,a)&&(0,L.oCacheGet)(e,a)||t,n=e.get().tabs[a]||t,i=(e.get().mutedPeers||[]).indexOf(a)>=0;return`<div class="${["im-popular--item","fl_l","_im_dialog","_dont_add_recent","_im_sugg_"+a,n.unread>0&&"sugg-is_unread",i&&"sugg-is_muted"].filter((e=>!!e)).join(" ")}" data-peer="${a}">\n    <a class="im-popular--avatar-w ${onlinePlatformClass(n.online)}" href="${r.link}"><img class="im-popular--avatar" src="${r.photo}"/></a>\n    <div class="im-popular--name-w"><a class="im-popular--name" href="${r.link}">${r.first_name||r.name}</a></div>\n    <span class="im-popular--unread _sugg_unread_ct">${lt(n.unread)}</span>\n</div>`})).join("")+"</li>"}function bt(e){if((0,f.getLocalSettingsValue)(e,"messages_recommendation_list_hidden"))return"<div></div>";var t=(0,H.getRecommendedConvoList)(e),a=t?t.items.map(((e,a)=>function(e,t){var a=(0,c.isContactPeer)(e.peer_id),r=a?`/im?sel=${e.peer_id}`:`/${e.screen_name}`,n=!a&&e.online&&e.online_info?"online"+(e.online_info.is_mobile?" mobile":""):"",i=a&&!e.photo?(0,w.getTemplate)("sImContactAvatar",{name:(0,y.getUserInitials)(e.name),size:46,classes:""}):(0,w.getTemplate)("sImUserAvatar",{src:e.photo,online_class:n,classes:""});return(0,w.getTemplate)("sImConvoRecommendListUser",{name:e.name,id:e.peer_id,link:r,photo:i,position:t,track_code:e.track_code})}(t.item_data[e],a))):[],r=[(0,w.getTemplate)("sImConvoRecommendListButton",{icon:(0,j.getIcon24UserOutline)().icon,title:(0,x.getLang)("mail_recommend_block_action_find_friends"),tag_name:"a",attributes:'href="/friends?act=find" target="_blank"'}),(0,w.getTemplate)("sImConvoRecommendListButton",{icon:(0,U.getIcon24SmartphoneOutline)().icon,title:(0,x.getLang)("mail_recommend_block_action_invite"),tag_name:"button",attributes:'data-action="invite_by_phone_number"',classes:"_convoRecommendAction"})],n=a.length?(0,w.getTemplate)("sImCarousel",{content:a.join("")+r.join(""),controls_class:"ConvoRecommendList__control",scroll_count:"4"}):r.join("");return(0,w.getTemplate)("sImConvoRecommendList",{list_content:n})}function Ct(e){return(0,A.unpackStore)(e).findFriendsStub||""}function Et(e){var t=Boolean(e&&mobPlatforms[e]);return{is_online:Boolean(e&&!t),is_mobile:t}}function yt(e){var t=(0,A.unpackStore)(e);return t.active_tab===b.FOLDER_ALL&&!(0,s.isCommunityInterface)(e)&&t.isRecommendationListEnabled}function Tt(e,t,a){var r=geByClass1("_im_mess_"+t.messageId,a);if(r){attr(r,"aria-hidden","false"),addClass(r,`im-mess_failed ${I.FAILED_CLASS}`);var n=geByClass1("_im_mess_marker",r);attr(n,"aria-label",(0,x.getLang)("mail_send_message_error")),attr(n,"role","link")}return a}function It(e,t,a){var r=geByClass1("_im_mess_"+t,a);if(r){removeClass(r,"im-mess_failed"),attr(r,"aria-hidden","true"),removeClass(r,I.FAILED_CLASS);var n=geByClass1("_im_mess_marker",r);attr(n,"aria-label",""),attr(n,"role","")}return a}function At(e,t){var a=e.map((e=>geByClass1("_im_mess_"+e,t))).filter((e=>e));return(0,V.removeMessagesWithStack)(a,t)}function Lt(e,t){var a=t||document,r=[];return e.forEach((e=>{var t=a.querySelector(`._im_expired_message_${e}`);if(t){var n=+t.dataset.count;if(t.dataset.count=n-1,t.classList.remove(`_im_expired_message_${e}`),1===n)(!domNS(t)||hasClass(domNS(t),"_im_bar_date"))&&(hasClass(domPS(t),"_im_bar_date")&&re(domPS(t)),hasClass(domPS(t),"_im_unread_bar_row")&&re(domPS(t))),re(t);else r.includes(t)||r.push(t)}})),r.length&&r.forEach((e=>{var t=+e.dataset.count;if(t>0){var a=er(t),r=se(a);r.classList.add(...e.classList),e.replaceWith(r)}})),t}function St(e){for(var t=e;t;){var a=t;if(null===(t=t.previousElementSibling)){hasClass(a,"mess_srv")&&(t=a.parentNode);var r=(0,F.gpeByClass)("_im_mess_stack",a);r&&(t=r.previousElementSibling,1===domChildren(a.parentNode).length&&r.parentNode.removeChild(r))}hasClass(a,"_im_unread_bar_row")||a.parentNode.removeChild(a)}}function kt(e,t,a,r){return e.map((e=>geByClass1("_im_mess_"+e,r))).filter((e=>e)).forEach((e=>{val(e,function(e,t,a){var r=t.innerHTML,n="delete"===a?"mail_deleted_stop":"mail_marked_as_spam";return`<div class="im-mess--text">\n    ${(0,x.getLang)(n)} <button type="button" data-peer="${e}" class="${Q} im-mess--btn">${(0,x.getLang)("mail_restore")}</button>\n    <div class="_im_mess_original im-mess--original">${r}</div>\n  </div>`}(t,e,a)),addClass(e,"im-mess_light")})),r}function Mt(e,t,a){var r=geByClass1("_im_mess_"+e,a);if(r){var n=geByClass1(W,r);val(r,n.innerHTML),removeClass(r,"im-mess_light")}return a}function Nt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(i)return Pt(e,t,a,r,!0,n);var s=60,o=Pt(e,t,a,r,!1,n);return o.length>s?Pt(e,t,a,r,!0,n):o}function wt(e){var t={[k.ACTIVITY_TYPE_TYPING]:1,[k.ACTIVITY_TYPE_RECORDING_AUDIO]:2},a=Object.keys(e).sort(((e,a)=>t[a]-t[e])),r={},n=a.reduce(((t,a)=>{var n=(e[a]||{}).userIds;return(void 0===n?[]:n).forEach((e=>{r[e]||(r[e]=!0,t[a]=!0)})),t}),{}),i=a.filter((e=>!!n[e]));return i.length>1?"":i[0]}function Pt(e,t,a,r,n,i){var o=function(e,t,a){var r=[],n={};return Object.keys(t).map((a=>{((t[a]||{}).userIds||[]).forEach((t=>{(0,L.oCacheExists)(e,t)?parseInt(t,10)!==e.id&&(n[t]=a):r.push(t)}))})),r.length&&(0,k.loadChatMember)({[a]:r},e),Object.keys(n).sort(((e,a)=>t[n[e]].ts-t[n[a]].ts))}(r,e,t);if(0===o.length)return"";var l=(0,c.isUserPeer)(t)||(0,s.isCommunityPeer)(t)?"first_name":n?"short_name":"name",d=wt(e),u="";d===k.ACTIVITY_TYPE_RECORDING_AUDIO?u=(0,x.getLang)("mail_recording_audio_several",o.length):d===k.ACTIVITY_TYPE_TYPING&&(u=(0,x.getLang)("mail_typing_several",o.length));var _=o.slice(0,Math.min(o.length-1,i)),g=_.map((e=>(0,L.oCacheGet)(r,e)[l])).join(", ");if(o.length>i+1){var m=function(e){var t={};return Object.keys(e).forEach((a=>{var r=e[a].userIds;(void 0===r?[]:r).forEach((e=>{t[e]=1}))})),Object.keys(t).length}(e);g+=" "+(0,x.getLang)("mail_and_peer").replace("{count}",m-i).replace("{typing}",u)}else{if(o.length>1&&(g+=` ${(0,x.getLang)("mail_and_peer_one")}`),!(0,c.isChatPeer)(t)&&a)g+=` ${u}`;else g+=` ${(0,L.oCacheGet)(r,o[_.length])[l]} ${u}`}return g.trim()}function Ot(){return`<div class="im-page--chat-search-empty">\n    ${(0,E.getIcon56MessagesOutline)().icon}\n    ${(0,x.getLang)("mail_im_search_empty")}\n  </div>`}function Rt(e,t,a,r){if(t===oe){var n=geByClass1("_im_mess_"+e.messageId,r);if(n){var i=a.tabs[e.peerId];n.parentNode.innerHTML=(0,w.getTemplate)("im_msg_row",{msg_id:e.messageId,cmid:e.chat_local_id,from_id:e.peerId,text:(0,I.renderServiceMsg)(a,e,i.peerId)+a.chat_photo_msg,ts:e.date,cls:"im-mess_srv _im_mess_srv"})}}return r}function Dt(e,t){return!t&&e===vk.id}function Ft(e,t){return(0,u.showTooltip)(e,{url:(0,s.isCommunityPeer)(t)?"al_groups.php":"al_profile.php",params:{act:"verified_tt",mid:t,gid:t},slide:15,ajxdt:200,showdt:200,hidedt:200,dir:"auto",shift:[94,7,7],className:"verified_tt"})}function xt(e){return function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bottom",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=se((0,w.getTemplate)("im_preloader",{preloader:rs(vk.pr_tpl,{id:""}),cls:["bottom"===a?"im-preloader_bottom":"im-preloader_top",r].join(" ")})),i=!1;function s(){i=!0,removeClass(n,"im-preloader_visible"),n.parentNode&&n.parentNode.removeChild(n),e&&e.classList.remove("_is-loading-list")}e.classList.add("_is-loading-list"),setTimeout((()=>{i||("bottom"===a?e.appendChild(n):e.insertBefore(n,domFC(e)),addClass(n,"im-preloader_visible"))}),0),t.then(s).catch((e=>{(0,M.imWeirdCatch)("wrapLoading",e),s()}))}}function Ht(e,t){return{0:{msgs:e.reduce(((e,t)=>(e[t]=[t,r.FLAG_IMPORTANT,0,0,"",{},{},0,0,0],e)),{}),hash:t,history:1}}}function Ut(e,t){if(!t&&!e)return!1;var a=e.target||e.srcElement,r=8,n=!1,i=/_im_mess|im_log_act|im_log_ract|_im_log_body|im_log_rspacer|_im_graffiti_w|_wall_post_cont/;do{if(!a||a.onclick||a.onmousedown||"A"==a.tagName||hasClass(a,"_im_no_select")||hasClass(a,"im_msg_media_link")||"IMG"==a.tagName&&!hasClass(a,"_im_graffiti")&&!hasClass(a,"emoji")&&!hasClass(a,"emoji_css")&&!hasClass(a,"im_gift")||"TEXTAREA"==a.tagName||hasClass(a,"im-gift--button")||hasClass(a,"GiftSnippetContent__button")||hasClass(a,"play_new")||hasClass(a,"videoplayer")||(n=i.test(a.className)))break}while(r--&&(a=a.parentNode));return!n||!!trim((window.getSelection&&window.getSelection()||document.getSelection&&document.getSelection()||"").toString())}function Bt(e,t){return`<div class="im-mess--text">\n      <span>${(0,x.getLang)("mail_restored")}</span>\n      <a class="_im_go_to" href="/im?sel=${st(e)}&msgid=${t}">${(0,x.getLang)("mail_im_goto_conversation")}</a>\n    </div>`}function Gt(e,t,a){var r=(0,x.getLang)("mail_deleteall1"),n=(0,x.getLang)("mail_sure_to_delete_all"),i=(0,x.getLang)("mail_delete");return(0,c.isChatPeer)(t)&&((0,H.doesChatTabHaveFlag)(e,1024)?(r=(0,x.getLang)("mail_leave_channel"),n=(0,x.getLang)("mail_unfollow_channel_confirmation"),i=(0,x.getLang)("mail_unfollow_channel")):n=(0,x.getLang)("mail_chat_sure_to_delete_all")),(0,s.isCommunityPeer)(t)&&(n=(0,x.getLang)("mail_group_sure_to_delete_all")),(0,_.showFastBox)(r,n,i,a,(0,x.getLang)("global_cancel"))}function jt(e,t,a){var r=(0,s.getTab)(e,t),n=(0,c.isChatPeer)(t),i=n&&(0,s.isChannelPeer)(r),o=n&&(0,s.tabIsMessageRequestToChat)(r),l=(0,x.getLang)("mail_deleteall1"),d=(0,x.getLang)("mail_sure_to_delete_all"),u=(0,x.getLang)("mail_delete");if(n){if(!(0,s.isChatActive)(r))return Gt(r,t,a.bind(null,!0));i?(l=(0,x.getLang)("mail_leave_channel"),d=(0,x.getLang)("mail_vkcomgroup_leave_confirm"),u=(0,x.getLang)("mail_leave_channel")):o?(l=(0,x.getLang)("mail_reject_mr_confirmation_title"),d=(0,x.getLang)("mail_reject_mr_confirmation_text"),u=(0,x.getLang)("mail_message_request_reject")):(l=(0,x.getLang)("mail_leave_chat"),d=(0,x.getLang)("mail_chat_leave_confirm"),u=(0,x.getLang)("mail_leave_chat"))}(0,s.isCommunityPeer)(t)&&(d=(0,x.getLang)("mail_group_sure_to_delete_all"));var g=new _.MessageBox({title:l,width:i?450:500}).content(d).setButtons(u,(()=>a(!!isChecked(geByClass1("_check_is_delete"))||!n)),(0,x.getLang)("global_cancel")).show();return!n||i||o||g.setControlsText(`<div class="checkbox im-delete-forall-checkbox _check_is_delete" onclick="checkbox(this);" role="checkbox" aria-checked="false">${(0,x.getLang)("mail_deleteall1")}</div>`),g}function qt(e){return(0,_.showFastBox)((0,x.getLang)("mail_unpin_title"),(0,x.getLang)("mail_unpin_text"),(0,x.getLang)("mail_unpin"),e,(0,x.getLang)("global_cancel"))}function Vt(e,t,a,r){var n=(0,x.getLang)("mail_dialog_msg_delete_N",t),i=(0,_.showFastBox)((0,x.getLang)("mail_dialog_msg_delete_title"),n,(0,x.getLang)("mail_delete"),(()=>r(isChecked(geByClass1("_check_forall")))),(0,x.getLang)("global_cancel")),s="",o=!1;return a&&(s=`<div class="checkbox im-delete-forall-checkbox _check_forall" onclick="checkbox(this);" role="checkbox" aria-checked="false">${(0,x.getLang)("mail_delete_for_all")}</div>`,o=cur.imDb.selectByKey("del_forall_checked")),i.setControlsText(s),o&&checkbox(geByClass1("_check_forall")),i}function zt(e,t,a,r,i){t.showProgress(),e.set(r.bind(null,i)).then((()=>{var r;t.hideProgress(),t.hide(),a().removePeer(e,i),a().updateDialogFilters(e);var s=e.get();[n.FOLDER_BUSINESS_NOTIFY,n.FOLDER_ARCHIVE].includes(s.active_tab)&&!(null===(r=s.dialog_tabs[s.active_tab])||void 0===r?void 0:r.length)&&s.longpoll.push([(0,h.changeTab)(n.FOLDER_ALL)])}))}function Yt(e,t,a,r){var n=e.get().tabs[t].memberIds;e.set(r.bind(null,"add_member",n)).then(a().showCreation)}function $t(e,t,a,r){var i=e.get();if(![n.FOLDER_BUSINESS_NOTIFY,n.FOLDER_ARCHIVE].includes(r)&&i.active_tab===n.FOLDER_ALL&&0===(0,q.getConvoListFolderCounterTotal)(i,r))return!1;var s=i.active_tab===r?n.FOLDER_ALL:r;return e.set((e=>a(s,e))).then(t)}function Kt(e,t,a){if(e.get().active_tab===n.FOLDER_ALL&&0===(0,f.getUnreadCountWithMuted)(e))return Promise.resolve(!1);var r=e.get().active_tab===n.FOLDER_UNREAD?n.FOLDER_ALL:n.FOLDER_UNREAD;return e.set(a.bind(null,r)).then((e=>{t().restoreDialogs(e,!0)})).then((()=>!0))}function Wt(e,t,a,r){if(t.get().active_tab===e&&e!==n.FOLDER_PEER_TAGS)return Promise.resolve(t);var i=(0,s.isReversedDialogs)(t);return t.set(r.bind(null,e)).then((e=>(a().restoreDialogs(e,!0,i!==(0,s.isReversedDialogs)(e)),e)))}function Qt(e,t){void 0===t&&(t=e.get().peer);var a=e.get().tabs[t];return n.FOLDER_MASKS[n.FOLDER_IMPORTANT]&a.folders}function Jt(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===t&&(t=e.get().peer),!(0,s.isFoldersAvailable)(e))return!1;var r=a||e.get().tabs[t];return!!(n.FOLDER_MASKS[n.FOLDER_UNRESPOND]&r.folders)}function Xt(e,t){return!1===((t.get().block_states||{})[e]||{}).free}function Zt(e){return null!=e.get().pendingForward}function ea(e,t){return(t.get().block_states[e]||{}).who===vk.id}function ta(e,t){var a=e.get().block_states;Object.keys(a).forEach((n=>{a[n].time?!1===a[n].free&&Date.now()-a[n].time>=5e4&&t.push([r.mutexEvent([,1,"gim"+e.get().gid,n,0,""])]):a[n].time=Date.now()}))}function aa(e,t,a){var r;return!showTabbedBox("al_im.php",{act:"a_spam",offset:"0",gid:e.get().gid},{onDone:(a,n)=>{n&&(r=t(a,e,n))},params:{width:638,onHide:()=>{AudioMessagePlayer.loaded&&AudioMessagePlayer.detachPlayer(!0),r.unmount()}}},a)}function ra(e,t){return na(e.get(),t,(0,s.getTab)(e,t).last_seen)}function na(e,t,a,r){if((0,C.isDialogWithYourself)(e.id,t))return"";if(a.platform)return(0,x.getLang)("mail_header_online_status")+(a.mobile?ia(t,!1,!1,!0):"");if(!a.can_see){var n=(0,L.oCacheGet)(e,t),i=n||e.tabs[t];return(0,P.getLastSeenByStatus)(a.status,i.sex)}if(!a.time||Date.now()-1e3*a.time>7776e6)return"";var s=getDateText(a.time,e.timeshift),o=langSex((0,L.oCacheGet)(e,t).sex,(0,x.getLang)("mail_last_activity_tip","raw")).replace("{user}","").replace("{time}",s);return a.mobile&&(o+=ia(t,!1,!1,r)),o}function ia(e,t,a,r){var n={mid:e};a||(n.was=1),t?n.forcetoup=!0:n.forcetodown=!0,n=Object.assign(n,r);var i=JSON.stringify(n).slice(1,-1).replace(/"/g,"&quot;");return(0,w.getTemplate)("im_wrap_mobile",{class:"im_status_mob_onl",params:i})}function sa(e,t){var a=t.get().tabs[e];return(0,_.showBox)("al_settings.php",{act:"blacklist_box",q:a.href},{stat:[jsc("web/settings.js"),"settings.css"],dark:1})}function oa(e,t){return(0,_.showBox)("groupsedit.php",{act:"bl_edit",name:"/id"+e,gid:t.get().gid},{stat:["page.css","ui_controls.js","ui_controls.css"],dark:1})}function la(e){return e.get().gid?"/gim"+e.get().gid:"/im"}function ca(e,t,a,r){var n;ka(showTabbedBox("al_im.php",{act:"a_important",offset:"0"},{onDone:(r,i)=>{i&&(n=a(r,e,t,i))},params:{width:638,onHide:()=>{AudioMessagePlayer.loaded&&AudioMessagePlayer.detachPlayer(!0)},onDestroy:()=>{n&&n.unmount()}}},r),e)}function da(){var e=document.activeElement;return null!==e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.getAttribute("contenteditable"))}function ua(e,t,a){var r=geByClass1("_im_mess_"+e,a);return r&&toggleClass(r,"im-mess_fav",t),a}function _a(e,t,a){var r=(0,s.getFirstUnread)(e,e.get().peer);if(!r)return[!1,0];var n=geByClass1(`_im_mess_${r}`,t);if(!n){var i=(0,s.getLastMessage)(e,e.get().peer,r);if(!i)return[!0,0];n=geByClass1(`_im_mess_${i.messageId}`,t)}var o=hasClass(n,"_im_mess_srv")?n:(0,F.gpeByClass)("_im_mess_stack",n);if(!o)return[!0,0];var l=n?n.offsetTop:0,c=o.offsetTop+l,d=a.contHeight();return c<=a.scrollTop()+a.getScrollHeight()?[!0,0]:[!1,Math.max(0,d-c)]}function ga(e,t,a){cancelEvent(t);var r=(0,F.gpeByClass)("_im_top_notice",a);fadeOut(r,200,re.pbind(r));var n=(0,F.gpeByClass)("_im_page_dialogs",r);n&&hasClass(n,"im-page--dialogs-notice")&&removeClass(n,"im-page--dialogs-notice"),ajax.post("al_im.php",{act:"a_hide_top_notice",type:r.getAttribute("data-type"),hash:r.getAttribute("data-hash")})}function ma(e,t,a){cancelEvent(t);var r=(0,F.gpeByClass)("_im_aside_notice",a);slideUp(r,200,re.pbind(r)),ajax.post("al_im.php",{act:"a_hide_top_notice",type:r.getAttribute("data-type"),hash:r.getAttribute("data-hash")})}function pa(e,t){cancelEvent(e);var a=(0,F.gpeByClass)("_im_aside_promo_block",t);slideUp(a,200,re.pbind(a)),ajax.post("al_im.php",{act:"a_hide_promo_block",type:a.getAttribute("data-type"),hash:a.getAttribute("data-hash")})}function ha(e,t){(0,F.gpeByClass)("_im_aside_promo_block",t).classList.add("--action-called"),ajax.post("al_im.php",{act:"a_vkadmin_app_install",hash:domData(t,"hash"),platform:domData(t,"platform")})}function fa(e){var t=e.filter((e=>"reply"!==e.type));return t.length>1?function(e){return[...e].sort(((e,t)=>"mail"!==e.type?"mail"===t.type?-1:1:0))}(t):t}function va(e,t,a,r,n){var i,s=function(e,t){var a=e.replace(/\<br\s*\/?\>(\n)?/gi," ").replace(/[\n\r]/gi," ");return a=(0,l.replaceMentions)(a,((e,t,a,r,n)=>n)),t&&(a=Emoji.emojiToHTML(a,!0)),a}(a,r);if(t&&"..."!==t.trim()&&!(0,c.isChatPeer)(e)&&(s=(0,w.getTemplate)("im_topic",{topic:t,cls:"im-topic_dialog"})+s),null===(i=s)||void 0===i?void 0:i.length)return s;var o=fa(n),d=$(o,1)[0];return d?(0,w.getTemplate)("im_dialog_media",{name:ba(d,o)}):(0,w.getTemplate)("sImEmptyDialogLastMessage")}function ba(e,t){var a={photo:(0,x.getLang)("mail_added_photos","raw"),video:(0,x.getLang)("mail_added_videos","raw"),audio:(0,x.getLang)("mail_added_audios","raw")};switch(e.type){case"mail":var r=e.object?e.object.fwd_count:e.id.split(";").length;return langNumeric(r,(0,x.getLang)("mail_fwd_msgs","raw"),!0);case"photo":case"video":case"audio":var n=t.filter((t=>t.type===e.type)).length;return langNumeric(n,a[e.type],!0);case"audio_playlist":return"audio_album"===e.kind?(0,x.getLang)("mail_added_audio_album"):(0,x.getLang)("mail_added_audio_playlist");case"artist":return(0,x.getLang)("mail_added_artist");case"doc":switch(e.kind){case"graffiti":return(0,x.getLang)("mail_added_graffiti");case"audiomsg":case"audio_message":return(0,x.getLang)("mail_added_audiomsg");default:return(0,x.getLang)("mail_added_docs")}case"geo":case"map":return(0,x.getLang)("mail_added_geo");case"wall":return(0,x.getLang)("mail_added_wall");case"wall_reply":return(0,x.getLang)("mail_added_wall_reply");case"gift":return(0,x.getLang)("mail_added_gift");case"link":case"share":return(0,x.getLang)("mail_added_link");case"sticker":return(0,x.getLang)("mail_added_sticker");case"market":return(0,x.getLang)("mail_added_market_item");case"money_transfer":return(0,x.getLang)("mail_added_money_transfer");case"money_request":return(0,x.getLang)("mail_added_money_request");case"story":return(0,x.getLang)("mail_added_story");case"mask":return(0,x.getLang)("mail_added_mask");case"article":return(0,x.getLang)("mail_added_article");case"call":case"group_call_in_progress":return(0,x.getLang)("mail_added_call");case"poll":return(0,x.getLang)("mail_added_poll");case"podcast":return(0,x.getLang)("mail_added_podcast");case"widget":return(0,x.getLang)("mail_added_widget");default:return(0,x.getLang)("mail_added_"+e.type)}}function Ca(e){addClass(e,"im-send-btn_loading")}function Ea(e){removeClass(e,"im-send-btn_loading")}function ya(e){var t=e.get(),a=(0,s.getPinnedMessage)(e);if(!a||!(0,S.isPinnedMessageVisibleInTab)(e,(0,f.getPeer)(e)))return"";var r=(0,L.oCacheGet)(e,a.userId);if(!r)return"";var n=function(e,t){var a="";if(t&&(0,o.isMoneyRequest)(t)&&void 0!==t.kludges.attach1_tr_amount){var r="%s "+t.kludges.attach1_currency;if("RUB"===t.kludges.attach1_currency&&(r=(0,x.getLang)("mail_money_amount_rub","raw")),t.kludges.attach1_total_amount){var n=langNumeric(t.kludges.attach1_tr_amount/1e3,"%s",!0),i=langNumeric(t.kludges.attach1_total_amount/1e3,r,!0);a=(0,x.getLang)("mail_money_request_collected_amount_from").replace("{amount}",n).replace("{total_amount}",i)}else{var s=langNumeric(t.kludges.attach1_tr_amount/1e3,r,!0);a=(0,x.getLang)("mail_money_request_collected_amount").replace("{amount}",s)}if(intval(t.kludges.attach1_held_amount)){var l=langNumeric(t.kludges.attach1_held_amount/1e3,r,!0);a+=" "+(0,x.getLang)("mail_money_request_held_amount").replace("{amount}",l)}t.text&&(a+='<span class="divider"></span>'+(0,I.parseMessageText)((0,A.unpackStore)(e),t.text,t.kludges)),t.kludges.attach1_total_amount&&(a+=(0,w.getTemplate)("im_pinned_message_media_bar",{percent:Math.min(100,Math.floor(t.kludges.attach1_tr_amount/t.kludges.attach1_total_amount*100))}))}return a}(e,a);if(!n)if(!(n=a.text)&&a.attaches.length){var i=fa(a.attaches);n=(0,w.getTemplate)("im_pinned_message_media",{text:ba(i[0],i)})}else n=(0,I.parseMessageText)(t,n,a&&a.kludges||{})||"";return n=n.replace(/<br\s?\/?>/gi," "),(0,w.getTemplate)("im_pinned_message",{date:getSmDate(a.date,t.timeshift),content:n,link:r.link,name:r.name})}function Ta(e,t,a){var r=a.getAttribute("data-info");r&&(0,u.showTooltip)(a,{text:r,className:"_im_history_tooltip",appendParentCls:"_im_mess_stack",black:1,hidedt:1e3,shift:[0,4]})}function Ia(e,t,a){var r=+a.getAttribute("data-time");r&&(0,u.showTooltip)(a,{text:(0,x.getLang)("mail_message_edited")+" "+getSmDate(r,e.get().timeshift),className:"_im_history_tooltip",appendParentCls:"_im_mess_stack",black:1,shift:[0,4]})}function Aa(e,t,a){var r=a.target,n=r.closest("."+Z),i=n.querySelector("._im_mess");if(i){var s,o=Number(i.getAttribute("data-cmid")),l=R.casperMessagesStore.getExpireTime(o),c="_im_bomb_tooltip_"+Math.round(1e4*Math.random()).toString(16);if(window.tooltips){var d=t.querySelectorAll(".im-mess-stack--bomb");Array.from(d).forEach((e=>{e!==r&&tooltips.hide(e,{fasthide:!0})}))}var _=La(e);(0,u.showTooltip)(r,{text:m(formatTime(l)),className:"_im_history_tooltip "+c,appendParentCls:Z,black:1,shift:[12,4],onShowStart:g,onShowEnd(){s=setTimeout(g,500)},onHide(){clearTimeout(s)},force:!0,toup:r.getBoundingClientRect().top>_+37,hasover:!0}),setTimeout(g,500)}function g(){var e=n.querySelector(`.${c} .tt_text`);e&&(e.innerHTML=m(formatTime(R.casperMessagesStore.getExpireTime(o)))),s=setTimeout(g,500)}function m(e){return`<div class="wrapped">${e}</div>`}}function La(e){var t=(0,f.getPeer)(e),a=(0,s.getTab)(e,t),r=(0,S.isPinnedMessageVisibleInTab)(e,(0,f.getPeer)(e))||a&&a.top_banner,n=(0,D.getPeerProfileHeight)(),i=a&&(0,s.tabIsMessageRequest)(a)&&!(0,s.tabIsRejectedMessageRequest)(a);return 105+(r?i?72:Sa(e):0)+n}function Sa(e){var t=(0,s.getPinnedMessage)(e);return t&&(0,o.isMoneyRequest)(t)?62:52}function ka(e,t){e.bodyNode.addEventListener("mouseover",(e=>{e.target.classList.contains("_im_edit_time")&&Ia(t,0,e.target),e.target.classList.contains("_im_page_info")&&Ta(0,0,e.target)})),e.bodyNode.addEventListener("click",(e=>{e.target.closest(`.${Ne}`)&&yr(e)}))}function Ma(e,t,a,r,n){var i,s=e.get();ka(showTabbedBox("al_im.php",{act:"a_get_pinned_message_box",chat:a,gid:e.get().gid,hash:s.tabs[a].hash},{onDone:(a,n)=>{n&&(i=r(a,e,t,n))},params:{width:638,containerClass:"im-show-message-box",onHide:()=>{AudioMessagePlayer.loaded&&AudioMessagePlayer.detachPlayer(!0)},onDestroy:()=>{i&&i.unmount()}}},n),e)}function Na(e,t,a){var r=e.get();ka(showTabbedBox("al_im.php",{act:"a_get_replied_message_box",chat:r.peer,msgid:t,gid:r.gid,hash:r.tabs[r.peer].hash},{onDone:(e,t)=>{},params:{width:638,onHide:()=>{AudioMessagePlayer.loaded&&AudioMessagePlayer.detachPlayer(!0)},onDestroy:()=>{}}},a),e)}function wa(e,t){return!(!(0,c.isChatPeer)(e.peerId)||!e.memberIds)&&e.memberIds.indexOf(t)>=0}function Pa(e){return!(0,c.isChatPeer)(e.peerId)||e.data.kicked?0:e.membersCount}function Oa(e,t){var a=[],r=t.find((e=>"mail"===e[0])),n=r?r[1].split(";"):[];for(n.length>Oe&&(r[1]=n.slice(0,Oe).join(";"));e.length>Pe;){var i=e.substr(0,Pe).lastIndexOf(" ");-1==i&&(i=Pe),a.push({msgText:trim(e.substr(0,i))}),e=trim(e.substr(i))}for(e.length&&a.push({msgText:e,attaches:t}),a.length||a.push({attaches:t}),n=n.slice(Oe);n.length;n=n.slice(Oe))a.push({attaches:[["mail",n.slice(0,Oe).join(";")]]});return a}function Ra(e){return e.length>Pe}function Da(e,t,a){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=Object.assign(Fa(t,r),{act:"a_chat_preview"}),s=!1;(0,_.showBox)("al_im.php",i,{stat:["boxes.css"],params:{dark:1,hideButtons:!0,onHide(){e.set(a),s&&s.unmount()}},onFail:e=>(setTimeout((()=>(0,_.showFastBox)((0,x.getLang)("global_error"),e)),0),!0),onDone(t){s=(0,m.mount)(t.bodyNode,e,n)}},{})}function Fa(e,t){return t?{chat_id:e.invite_chat_id,hash:e.invite_hash,link:e.invite_link}:e}function xa(){(0,_.showFastBox)((0,x.getLang)("global_error"),(0,x.getLang)("mail_message_wait_until_uploaded"))}function Ha(e,t){var a=(0,s.getTab)(e,t.peerId)||{},r=e.get(),n=(0,c.isChatPeer)(t.peerId)&&(0,N.isUserAdminInChat)(a,r.id),i=(0,c.isChatPeer)(t.peerId)&&(0,N.isUserAdminInChat)(a,t.userId);if(!t)return!1;if(!(0,o.isOut)(t)&&(!n||i))return!1;if(333==t.peerId)return!1;if(Date.now()/1e3-t.date>86400)return!1;if(Ue(e,t.peerId,t.messageId))return!1;if((0,c.isChatPeer)(t.peerId)){if(!(0,s.isChatActive)(a))return!1}else if(a.block_error>0)return!1;return!0}function Ua(e,t){return t.map((t=>(0,L.oCacheGet)(e,t)))}function Ba(e,t){if("number"!=typeof e||0===e)return"";var a,r=[[31536e3,t?(0,x.getLang)("global_years_accusative","raw"):(0,x.getLang)("global_age_years","raw")],[2592e3,t?(0,x.getLang)("global_months_accusative","raw"):(0,x.getLang)("global_age_months","raw")],[604800,t?(0,x.getLang)("global_weeks_accusative","raw"):(0,x.getLang)("global_age_weeks","raw")],[86400,t?(0,x.getLang)("global_days_accusative","raw"):(0,x.getLang)("global_age_days","raw")],[3600,t?(0,x.getLang)("global_hours_accusative","raw"):(0,x.getLang)("global_hours","raw")],[60,t?(0,x.getLang)("global_minutes_accusative","raw"):(0,x.getLang)("global_minutes","raw")],[1,t?(0,x.getLang)("global_seconds_accusative","raw"):(0,x.getLang)("global_age_seconds","raw")]],n=e,i=[];if(r.forEach((e=>{var t=$(e,2),a=t[0],r=t[1],s=Math.floor(n/a);n%=a,s>=1&&i.push(langNumeric(s,r))})),1===(a=i.length))return i.pop();var s=i.slice(0,a-1).join(", "),o=i.pop();return(0,x.getLang)("global_and").replace(/{before}/gi,s).replace(/{after}/gi,o)}function Ga(e,t,a,r){r&&!Ue(e,a,r)&&((0,s.getMessage)(e,a,r)?(e.setState({msgid:r}),(0,i.updateLocation)({msgid:r}),t()):e.get().longpoll.push([(0,h.changePeer)(a,r)]))}function ja(e){var t=geByClass1("im-mess_is_editing");if(!t)return null;var a=e.get().tabs[e.get().peer],r=(0,s.parserMessage)(a.msgs[domData(t,"msgid")]);return r&&r.peerId==e.get().peer?r:null}function qa(e,t){var a="unshown";if((0,s.isClassicInterface)(e)){var r=document.getElementById("ui_rmenu_mr");r&&((0,s.existsIncomingMessageRequest)(e)?r.classList.remove(a):r.classList.add(a))}else t(e)}function Va(){for(var e=curBox();e;)e.hide(),e=curBox()}function za(e,t){return(0,x.getLang)("mail_invitation_sended_ago").replace("{when}",getDateText(e,t))}function Ya(e,t){var a=(0,f.getPeer)(e),r=(0,s.getMessage)(e,a,t);return(0,N.canPinOrUnpin)(e,a)&&!(0,o.isCasperMessage)(r)}function $a(e,t){var a=(0,f.getPeer)(e);return!t.find((t=>{var r=(0,s.getMessage)(e,a,t);return(0,o.isCasperMessage)(r)}))}function Ka(e,t){var a=(0,f.getPeer)(e);return!t.find((t=>{var r=(0,s.getMessage)(e,a,t);return(0,o.isCasperMessage)(r)}))}function Wa(e,t){var a=R.casperMessagesStore.isProcessed(e.chat_local_id),r=R.casperMessagesStore.has(e.chat_local_id),n=R.casperMessagesStore.getExpireTime(e.chat_local_id)>R.MAX_DEVIATION;(!r&&!a||r&&n)&&t(e),r&&n&&R.casperMessagesStore.remove(e.chat_local_id)}function Qa(e){return e===vk.id}function Ja(e,t){return(0,c.isUserPeer)(t)&&!Qa(t)&&!(0,s.isCommunityInterface)(e)&&!(0,c.isContactPeer)(t)}function Xa(e,t){var a=e.get(),r=(0,s.isCommunityInterface)(e);return(0,c.isUserPeer)(t)&&!Qa(t)&&!r&&!inArray(t,a.moneyTransferExcept)&&!(0,c.isContactPeer)(t)||(0,s.isCommunityPeer)(t)&&a.moneyTransferCommAvail&&(0,H.getCurrentTab)(e).moneyTransferAvail&&!r||r&&a.moneyRequestAvail&&!(0,c.isChatPeer)(t)||(0,c.isChatPeer)(t)&&(0,H.getCurrentTab)(e).moneyRequestAvail&&!(0,s.isCasperChat)(e,t)}function Za(e,t,a){var r="im-expired-message",n=geByClass1(`_im_mess_${a.messageId}`,t),i=n&&n.closest(we);if(!n||!i)return t;var s,o,l,c=Array.from(i.querySelectorAll("._im_mess")),d=$((o=(s=i).previousElementSibling,l=s.nextElementSibling,[o&&1===o.nodeType?o:null,l&&1===l.nodeType?l:null]),2),u=d[0],_=d[1],g=u&&u.classList.contains(r),m=_&&_.classList.contains(r),p=g&&0===c.findIndex((e=>+e.getAttribute("data-msgid")===a.messageId)),h=m&&c.findIndex((e=>+e.getAttribute("data-msgid")===a.messageId))===c.length-1,f=er((p?+u.getAttribute("data-count"):0)+(h?+_.getAttribute("data-count"):0)+1,`_im_expired_message_${a.messageId}`),v=se(f);if(p&&(v.classList.add(...u.classList),u.remove()),h&&(v.classList.add(..._.classList),_.remove()),1===c.length)i.replaceWith(v);else{var b=$(c.reduce(((e,t)=>{var r=+t.getAttribute("data-msgid");return r<a.messageId&&e[0].push(t),r>a.messageId&&e[1].push(t),e}),[[],[]]),2),C=b[0],E=b[1];i.replaceWith(se(tr(e,C))||"",v,se(tr(e,E))||"")}return t}function er(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,w.getTemplate)("sImExpiredMessagePlaceholder",{text:langNumeric(e,(0,x.getLang)("mail_messages_expired","raw")).replace("{count}",e),count:e,id_classes:(0,d.classNames)(t)})}function tr(e,t){if(0===t.length)return"";var a=+t[0].getAttribute("data-peer"),r=+t[0].getAttribute("data-msgid"),n=(0,s.getMessage)(e,a,r);return(0,w.getTemplate)("im_mess_stack",Object.assign((0,I.getStackDataFromMessage)(e,n),{messages:t.reduce(((e,t)=>e+t.outerHTML),"")}))}function ar(e,t){var a=`._im_replied_message[data-msgid="${t.messageId}"]`;Array.from(e.querySelectorAll(a)).forEach((e=>{var t=e.querySelector(".im-replied--text"),a=e.querySelector(".im-replied--photo-wrapper");t.innerHTML=(0,w.getTemplate)("im_dialog_media",{name:(0,x.getLang)("mail_expired_message")}),a.innerHTML=""}))}function rr(e){return(0,c.isChatPeer)(e.peerId)&&e.membersCount?langNumeric(e.membersCount,(0,x.getLang)("mail_im_n_chat_members","raw")):""}var nr=p.CallStatSource.CONVO_SNIPPET,ir=p.CallStatSource.CONVO_HEADER,sr=p.CallStatSource.CONVO_LIST,or=p.CallStatSource.CONVO_JOIN_SNIPPET,lr=p.CallStatSource.CONVO_JOIN_HEADER,cr=p.CallStatSource.CONVO_JOIN_BANNER,dr=p.CallStatSource.WIDGET;function ur(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(window.Calls&&window.Calls.call&&!window.Calls.isInActiveCall){if(i)return void window.Calls.showStartCallModal(t);if(o)return void window.Calls.showCallByNamePopup(t,n);if(!t)return void window.Calls.startCall(a,n);var l=(0,c.isChatPeer)(t);if(l){var d=(0,s.getTab)(e,t),u=Y({},d,{canAddMembers:(0,N.canInviteUser)(e,t,void 0)});window.Calls.startGroupCall(t,[u],r,a,n)}else{var _=(0,L.oCacheGet)(e,t),g=Y({},_,{canAddMembers:!0});window.Calls.call(t,a,[g,[_]],n)}}}function _r(e){var t=decodeURIComponent(e.target.getAttribute("href"));if(t&&window.Calls&&window.Calls.showJoinPopup)return cancelEvent(e),window.Calls.showJoinPopup(t,p.CallStatSource.LINK_JOIN_SNIPPET)}function gr(e,t){var a=(0,s.getTab)(e,t);return!(0,s.isCommunityInterface)(e)&&!!a.can_start_call}function mr(e,t,a){if(window.Calls&&window.Calls.call&&!window.Calls.isInActiveCall){var r=(0,s.getTab)(e,t);if(!(0,s.isChatActive)(r))return;window.Calls.showStartCallModal(null,a)}}function pr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=t?`&msgid=${t}`:"";return`/im?sel=${st(e)}${a}`}function hr(e,t){(0,_.showBox)("al_im.php",{act:"group_calls_onboarding_box"},{params:{hideButtons:!0,hideOnBGClick:!1,width:655,onHide:()=>{"group_calls"===nav.objLoc.promo&&(delete nav.objLoc.promo,nav.setLoc(nav.objLoc)),ls.remove("group_calls_tooltip_shown"),ajax.post("al_index.php",{act:"hide_feature_tt",hash:t,type:"group_calls"})}},containerClass:"GroupCallsOnboarding",onDone:t=>{var a=t.bodyNode,r=a.querySelector(".GroupCallsOnboarding__call-button"),n=a.querySelector(".GroupCallsOnboarding__skipButton"),i=a.querySelector(".GroupCallsOnboarding__closeButton"),o=ge("box_layer",t.bodyNode),l=function(){t.hide();var a=new ElementTooltip(geByClass1("_im_create_call"),{content:(0,x.getLang)("mail_group_calls_im_search_tt"),forceSide:"bottom",cls:"feature_intro_tt feature_intro_blue_tt",autoShow:!1,appendTo:geByClass1("_im_dialogs_search"),width:250,offset:(0,s.isClassicInterface)(e)?[10,25]:[13,12],rightShift:30,onHide:function(){(0,g.removeEvent)(a._ttel,"click")}});a.show(),(0,g.addEvent)(a._ttel,"click",(()=>a.hide())),cur.destroy.push((()=>{(0,g.removeEvent)(a._ttel,"click"),a.destroy()}))};(0,g.addEvent)(r,"click",(()=>{t.hide(),ur(e,null,!1,null,sr)})),(0,g.addEvent)(n,"click",l),(0,g.addEvent)(i,"click",l);var c=e=>{e.target===o&&((0,g.removeEvent)(o,"click",c),l())};(0,g.addEvent)(o,"click",c),cur.destroy.push((()=>{(0,g.removeEvent)(n,"click"),(0,g.removeEvent)(i,"click"),(0,g.removeEvent)(r,"click"),(0,g.removeEvent)(o,"click",c),t.hide(),t.destroy()}))}})}function fr(e,t){cur.groupCallsTooltip||"im"!==cur.module||!isVisible("im_dialogs_search")||cur.introTooltipShow||setTimeout((function(){var a=()=>{cur.groupCallsTooltip&&cur.groupCallsTooltip.destroy(),ajax.post("al_index.php",{act:"hide_feature_tt",hash:t,type:"group_calls_new_year"})};cur.groupCallsTooltip=new ElementTooltip(geByClass1("_im_create_call"),{content:(0,x.getLang)("mail_group_calls_im_search_new_year_tt"),forceSide:"bottom",cls:"feature_intro_tt feature_intro_blue_tt",autoShow:!1,appendTo:geByClass1("_im_dialogs_search"),width:200,offset:(0,s.isClassicInterface)(e)?[10,25]:[13,12],rightShift:30,onHide:function(){cur.groupCallsTooltip&&((0,g.removeEvent)(cur.groupCallsTooltip._ttel,"click",a),cur.groupCallsTooltip.destroy()),ajax.post("al_index.php",{act:"hide_feature_tt",hash:t,type:"group_calls_new_year"})}}),cur.groupCallsTooltip.show(),(0,g.addEvent)(cur.groupCallsTooltip._ttel,"click",a),cur.destroy.push((function(){cur.groupCallsTooltip&&((0,g.removeEvent)(cur.groupCallsTooltip._ttel,"click",a),cur.groupCallsTooltip.destroy())}))}),1e3)}function vr(e,t){var a=20,r=document.querySelector("._im_aside_notice");return r&&(a+=r.offsetHeight),(0,s.isCommunityInterface)(e)?a+=268:(a+=120,e.get().hasContacts&&(a+=32),(0,s.existsIncomingMessageRequest)(e)&&(a+=32)),Math.floor((t-a)/32)}function br(e,t,a,r){var n=r?()=>r.removeDialog(e,t):null,i=()=>(0,s.isClassicInterface)(e)&&a().updateMenu(e);return((0,s.getTab)(e,t)?Promise.resolve():e.set((e=>(0,z.loadPeer)(e,t,0,!1,!1,"chatInvite")))).then((()=>{var a=(0,s.getTab)(e,t);return(0,s.tabIsMessageRequestToChat)(a)?Da(e,{receiver_peer_id:t},k.leaveInvitation,!1,{updateList:n,updateMenu:i}):e.get().longpoll.push([(0,h.changePeer)(t,!1,!1,!1,"")])}))}function Cr(e,t){var a=e.closest(`.${ee}`)?"BotCarousel__slideButton--isLoading":"MessageKeyboard__button--isLoading";e.disabled=t,e.classList.toggle(a,t)}function Er(e,t,a){var r=e.querySelector(`._im_mess_${t}`);return r?r.querySelector(`.${X}[data-index="${a}"]`):null}function yr(e){var t=e.target.closest(`.${Me}`);cancelEvent(e),t&&t.classList.toggle("im_msg_audiomsg--transcription-expanded")}},266372:(e,t,a)=>{"use strict";a.d(t,{BUTTON_TYPE_OPEN_LINK:()=>A,BUTTON_COLOR_DEFAULT:()=>L,handleOpenLink:()=>k,handleShowSnackbar:()=>N,handleCallbackAction:()=>O,CALLBACK_TIMEOUT_MS:()=>R,handleButtonClick:()=>D,getButtonAppearance:()=>F,getButtonLabel:()=>x,getActionObjectFromElement:()=>U,getAttributesFromActionObject:()=>B,sendLocationFromKeyboard:()=>G});a(530522),a(66108),a(579665),a(95767),a(991181),a(296253),a(83276),a(59357),a(21466);var r=a(695724),n=a(495283),i=a(850167),s=a(654612),o=a(884137),l=a(240367),c=a(475234),d=a(459554),u=a(309756),_=a(826338),g=a(993421),m=a(606542),p=a(827749),h=a(712439),f=a(251976),v=a(254692);function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return C(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var E=7131443,y="vkpay",T="location",I="open_app",A="open_link",L="default",S=["app-id","owner-id","type","payload","hash","label","link"];function k(e,t){var a=new URL(e);if(!!a.hostname.match(v.OUR_DOMAINS))window.open(e);else{var r=new s.MessageBox;r.setOptions({title:getLang("mail_callback_popup_title"),bodyStyle:"overflow: hidden; text-overflow: ellipsis;"});var n=getLang("mail_callback_popup_text").replace("{name}",t).replace("{domain}",a.hostname);r.content(n),r.addButton(getLang("box_cancel"),!1,"no"),r.addButton(getLang("global_open"),(()=>{window.open((0,o.wrapAwayIfExternal)(e,!0)),r.hide()})),r.show()}}function M(e){var t=e.type,a=e.appId,r=e.ownerId,n=e.hash,s=e.appHash,o="app"+(t===y?E:a)+(r?"_"+r:"");(0,i.showWiki)({w:o+encodeURIComponent("#"+n),from_keyboard:1,app_hash:s})}function N(e){var t=e.peerId,a=e.ownerId,r=e.text,n=e.store,i=(0,d.getTab)(n,t),s=(0,m.oCacheGet)(n,a),o=(0,_.isChatPeer)(t)&&s?s.photo:void 0;(0,u.showNotification)({text:r,title:i.name,photo:o})}var w=["open_link","open_app"];function P(e){var t=setTimeout((()=>e.set(c.unsetActionCallbackTimeout)),2e3);e.set((e=>(0,c.setActionCallbackTimeout)(t,e)))}function O(e,t){var a=e.action,r=(0,g.getPeer)(t)===e.peer_id;if(a&&r&&!(w.includes(e.action.type)&&(0,g.getActionCallbackTimeout)(t)))switch(e.action.type){case"open_link":!function(e){var t=e.peerId,a=e.store;k(e.link,(0,d.getTab)(a,t).name)}({peerId:e.peer_id,link:a.link,store:t}),P(t);break;case"open_app":M({type:a.type,appId:a.app_id,ownerId:a.owner_id,hash:a.hash,appHash:(0,g.getKeyboardAppHash)(t)}),P(t);break;case"show_snackbar":N({peerId:e.peer_id,ownerId:e.owner_id,text:a.text,title:a.title,store:t});break;default:return}}var R=6e4;function D(e,t,a,r){var n=e.app_id,i=e.owner_id,s=e.type,o=e.payload,c=e.hash,d=void 0===c?"":c,u=e.link,m=void 0===u?"":u,v=r.keyboardAuthorId,b=(0,g.getKeyboardAppHash)(a);switch(s){case A:(0,g.getPeer)(a)===f.VK_OFFICIAL_PEER_ID&&(0,_.isOnboardingFindFriendsLink)(m)&&(0,p.collectOnboardingFindFriendsClickStats)((0,h.unpackStore)(a).viewer_id);break;case y:case I:M({type:s,appId:n,ownerId:i,hash:d,appHash:b});break;case T:G((e=>t({keyboardAuthorId:v,action:{label:"",attaches:[e],payload:o}})));break;case"text":t({action:e,appHash:b,keyboardAuthorId:v});break;case"callback":var C=r.message,E=r.peerId,L=r.onBeforeSend,S=void 0===L?()=>{}:L,k=r.onSendSuccess,N=void 0===k?()=>{}:k,w=r.onSendFail,P=void 0===w?()=>{}:w;S(),(0,l.sendMessageEvent)({author_id:v,conversation_message_id:null==C?void 0:C.chat_local_id,message_id:null==C?void 0:C.messageId,peer_id:E,payload:e.payload}).then(N,P);break;default:e.payload=JSON.stringify({command:"not_supported_button",button_type:s,payload:e.payload}),t({action:e,appHash:b,keyboardAuthorId:v})}}function F(e){return H(e)?"primary":e.color.toLowerCase().replace(L,"secondary")}function x(e){var t=e.action,a=t.label;return t.type===T?getLang("mail_keyboard_label_location"):H(e)?getLang("mail_keyboard_label_vkpay").replace(/ VK Pay$/,""):function(e){var t=e;return t=(0,n.decodeHTMLEntities)(t||""),t=(0,r.clean)(t).replace(/\n(\r)?/gi," "),t=Emoji.emojiToHTML(t,!0)}(a)}function H(e){var t=e.action,a=t.app_id,r=t.type;return r===y||r===I&&a===E}function U(e){return S.reduce(((t,a)=>(t[a.replace("-","_")]=e.getAttribute("data-"+a)||void 0,t)),{})}function B(e,t){var a=Object.entries(e).reduce(((e,t)=>{var a=b(t,2),n=a[0],i=a[1];return e+` data-${n.replace("_","-")}="${(0,r.clean)(""+i)}"`}),"");e.type===A&&(a+=` href="${(0,o.wrapAwayIfExternal)(encodeURI(e.link),!0)}" target="_blank" rel="nofollow noopener"`);return a+=` data-index="${t}"`}function G(e){cur.sendLocation=function(t,a){a(),e(t)},(0,s.showBox)("al_places.php",{act:"a_choose_place_box",from_keyboard:1},{stat:["places.css","map.css","maps.js","ui_controls.css","ui_controls.js","boxes.css"],width:640,bodyStyle:"padding: 0px;",dark:1})}},294940:(e,t,a)=>{"use strict";a.d(t,{isOut:()=>n.isOutbound,isServiceMsg:()=>n.isServiceMsg,isGraffiti:()=>n.isGraffiti,isAudioMsg:()=>n.isAudioMsg,isSticker:()=>n.isSticker,isGift:()=>n.isGift,isMoney:()=>n.isMoney,isMoneyRequest:()=>n.isMoneyRequest,isVKPay:()=>n.isVKPay,isCasperMessage:()=>n.isCasperMessage,isCallMessage:()=>n.isCallMessage,hasReply:()=>n.hasReply,isUnread:()=>n.isUnread,isImportant:()=>n.isImportant,isMessageToBlockedCommunity:()=>n.isMessageToBlockedCommunity,isMessageEmpty:()=>n.isMessageEmpty,getMessageTTL:()=>n.getMessageTTL,isExpiredCasperMessage:()=>n.isExpiredCasperMessage,getUserId:()=>i,getAuthorId:()=>s});var r=a(982452),n=a(376473);function i(e){return(0,n.isOutbound)(e)?vk.id:e.userId}function s(e,t){var a=(0,r.unpackStore)(e);return(0,n.isOutbound)(t)?a.id:t.userId}},499349:(e,t,a)=>{"use strict";a.d(t,{onPeerTagsExtraHover:()=>v,renderPeerTags:()=>C,renderPeerTagsFilter:()=>E,initPeerTagsFilter:()=>y,onPeerTagsFilterCheckboxChange:()=>T,onPeerTagsFilterPaneItemClick:()=>I,renderPeerTagsFilterPane:()=>A,onDialogPeerTagClick:()=>S,isPeerTagsFolder:()=>k,convertPeerTagsFilterToMask:()=>N,onPeerTagsChangeEvent:()=>w,onPeerProfileTagsChangedEvent:()=>P,applyPeerTagsFilterToTab:()=>O,updateEmptyDialogsMargin:()=>R});a(530522),a(991181),a(579665),a(95767),a(66108),a(296253),a(751876),a(820075);var r=a(454593),n=a(104837),i=a(254692),s=a(315544),o=a(786067),l=a(376852),c=a(495283),d=a(645523);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var g="_im_page_dialogs",m="PeerTagsFilter__control--hidden",p="_im_peer_tags_filter_pane",h="_im_peer_tags_filter_pane_item";function f(e,t){var a=0,r=[],n=[],i=!1;return e.forEach((e=>{e.width=e.width?e.width:function(e){return 12+9*(0,c.decodeHTMLEntities)(e.name).length}(e),e.width+(i?0:69)>=t-a?(n.push(e),i||(a+=69,i=!0)):(r.push(e),a+=e.width)})),[r,n]}function v(e,t){var a=e.target,r=(0,s.gpeByClass)("_im_dialog",a),i=parseInt((0,s.domData)(r,"peer")),o=t.get(),c=(0,n.getTab)(o,i),d=c.peerTagsMaxWidth;if(d){var _=u(f(b(o,c),d),2)[1].reduce(((e,t)=>e+=getTemplate("sImPeerTagsExtraTooltipItem",{name:t.name,color:t.color})),"");(0,l.showTooltip)(a,{text:_,center:!0,dir:"bottom",className:"PeerTagsExtraTooltip",hasover:!0})}}function b(e,t){var a=t.peer_tags&&t.peer_tags.ids.length?e.peer_profile_tags.filter((e=>t.peer_tags.ids.includes(e.id))):[];return t.ad_id&&a.unshift(function(e){var t,a;return e.is_easy_promoted_market?(t=(0,o.getLang)("mail_ad_tag_easy_promoted_market"),a=145):(t=e.has_ad_access?`${(0,o.getLang)("mail_ad_tag_text_prefix")} ${e.ad_id}`:(0,o.getLang)("mail_ad_tag_no_access_text"),a=e.has_ad_access?104:97),{isAdTag:!0,adTagText:t,width:a,name:t,color:"#e5ebf1"}}(t)),a}function C(e,t,a,r){if(t<69)e.innerHTML="";else{e.style.maxWidth=t+"px";var i=a.get(),s=(0,n.getTab)(i,r),l=b(i,s);if(l.length){var c=u(f(l,t),2),d=c[0],_=c[1],g=d.reduce(((e,t)=>(t.isAdTag?e+=getTemplate("sImPeerTagsAdTag",{ad_tag_text:t.adTagText,url:`ads?act=office&union_id=${s.ad_id}&utm_medium=community_messages_ad_tag&utm_source=dialog`,extra_class:s.has_ad_access?"PeerTagsItem--hasAdAccess":""}):e+=getTemplate("sImPeerTagsItem",{tag_id:t.id,name:t.name,color:t.color}),e)),""),m=_.length,p=`+${(0,o.getLang)("mail_im_peer_profile_extra_tags",m)}`;m&&(g+=getTemplate("sImPeerTagsExtra",{text:p})),e.innerHTML=g}else e.innerHTML=""}}function E(e){var t=(0,s.geByClass1)("_im_peer_tags_filter_tags"),a=e.peer_profile_tags||[];a.length>0&&t&&(t.innerHTML=a.reduce(((t,a)=>t+=getTemplate("sImPeerTagsFilterItem",{tag_id:a.id,name:a.name,color:a.color,checked:e.peer_tags_filter.ids.includes(a.id)?"checked":"",count:a.uses})),""))}function y(e){var t=e.get(),a=(0,s.geByClass1)("_im_peer_tags_filter_control");if(a)if(!t.peer&&t.peer_profile_tags&&t.peer_profile_tags.length>0){(0,s.removeClass)(a,m);var n=M(t.peer_profile_tags,t.peer_tags_filter.mask);e.set((e=>(0,r.updatePeerTagsFilter)(n,e))).then((()=>L(e,n,!0)))}else(0,s.addClass)(a,m)}function T(e,t){var a=t.get(),n=e.target,i=parseInt(n.id.slice(9)),s=n.checked?[].concat(a.peer_tags_filter.ids,i):a.peer_tags_filter.ids.filter((e=>e!==i));t.set((e=>(0,r.updatePeerTagsFilter)(s,e))).then((()=>L(t,s)))}function I(e,t){var a=t.get(),n=(0,s.hasClass)(e.target,h)?e.target:(0,s.gpeByClass)(h,e.target),i=parseInt((0,s.domData)(n,"id")),o=a.peer_tags_filter.ids.filter((e=>e!==i));t.set((e=>(0,r.updatePeerTagsFilter)(o,e))).then((()=>L(t,o)))}function A(e){var t,a,r=e.peer_tags_filter.ids,n=r.length>0,i=(0,s.geByClass1)(p),o=(t=(0,s.geByClass1)(g),a=(0,s.geByClass1)(p),parseFloat(getComputedStyle(t)["padding-top"])-(a&&a.offsetHeight>0?a.offsetHeight+1:0));if(n&&i){var l=(e.peer_profile_tags||[]).filter((e=>r.includes(e.id))).sort(((e,t)=>r.indexOf(e.id)-r.indexOf(t.id)));i.innerHTML=l.reduce(((e,t)=>e+=getTemplate("sImPeerTagsFilterPaneItem",{tag_id:t.id,name:t.name,color:t.color})),"")}(0,s.toggleClass)(i,"PeerTagsFilterPane--active",n),function(e,t){var a=(0,s.geByClass1)(g),r=(0,s.geByClass1)(p);if(e&&r){var n=t+(r.offsetHeight+1);a.style.paddingTop=`${n}px`}else a.style.paddingTop=`${t}px`}(n,o),R()}function L(e,t,a){var r=e.get();E(r),A(r),function(e){var t=(0,s.geByClass1)("_im_right_menu"),a=(0,s.geByClass1)("ui_rmenu_item_sel",t),r=(0,s.geByClass1)("_ui_item_all",t);(e.length>0||!a)&&uiRightMenu.switchMenu(r)}(t),a||r.longpoll.push([(0,d.changeTab)(t.length>0?i.FOLDER_PEER_TAGS:i.FOLDER_ALL)])}function S(e,t){var a=e.target,n=[parseInt((0,s.domData)(a,"id"))];t.set((e=>(0,r.updatePeerTagsFilter)(n,e))).then((()=>L(t,n)))}function k(e){return e.get().active_tab===i.FOLDER_PEER_TAGS}function M(e,t){if(!e||!e.length||!t)return[];var a=t.toString(2).split("").reverse().reduce(((e,t,a)=>("1"===t&&e.push(1<<a),e)),[]);return e.filter((e=>a.includes(e.mask))).map((e=>e.id))}function N(e,t){return Number.isInteger(t)?t:e&&e.length&&t&&t.length?e.filter((e=>t.includes(e.id))).reduce(((e,t)=>e+=t.mask),0):null}function w(e,t,a){var n=a.peerId,i=a.peerTagsMask,s=e.get(),o=M(s.peer_profile_tags,i);e.set((e=>(0,r.updatePeerTags)(n,o,i,e))).then((()=>{E(e.get()),s.peer||(t.renderPeerTags(e,n),k(e)&&e.set(r.updatePeerTagsFilterFolder).then((()=>t.restoreDialogs(e))))}))}function P(e,t){e.set(r.updatePeerProfileTags).then((()=>{E(e.get()),e.get().peer||(t.restoreDialogs(e),t.renderPeerTags(e))}))}function O(e,t){var a=e.peer_tags_filter.mask;return!(!a||!t.peer_tags)&&!!(a&t.peer_tags.mask)}function R(){var e=(0,s.geByClass1)("im-page--dialogs-empty");if(e){var t=(0,s.geByClass1)(p),a=t&&t.offsetHeight>0?t.offsetHeight/2:5;e.style.marginTop=`${a}px`}}},18149:(e,t,a)=>{"use strict";a.d(t,{vkIndexer:()=>r});a(820075),a(976142),a(66108),a(296253),a(751876),a(283946);function r(e,t,a){this.list=e,this.iterCur=0,this.iterEnd=e?e.length:0,this.index={},this.callback=a||function(){},this.prepareFunc=t||function(e){return e},setTimeout(this.indexIteration.bind(this),10)}r.prototype.delimiter=r.delimiter=new RegExp("[\\s\\-\\.,\\\"\\'\\«\\(\\)\\[\\]\\{\\}\\#\\+\\?\\\\]+","g"),r.prototype.trimmer=new RegExp("^[\\s\\-\\.,\\\"\\'\\«\\(\\)\\[\\]\\{\\}\\+\\?\\\\]+|[\\s\\-,\\\"\\'\\«\\(\\)\\[\\]\\{\\}\\\\]+$","g"),r.prototype.toTranslit={1072:"a",1073:"b",1074:"v",1075:"g",1076:"d",1077:"e",1078:"zh",1079:"z",1080:"i",1081:"y",1082:"k",1083:"l",1084:"m",1085:"n",1086:"o",1087:"p",1088:"r",1089:"s",1090:"t",1091:"u",1092:"f",1093:"h",1094:"ts",1095:"ch",1096:"sh",1097:"sh",1099:"y",1101:"e",1102:"yu",1103:"ya",1105:"e",1098:"",1100:""},r.prototype.toLocalCase={f:"a",",":"b","<":"b",d:"v",u:"g",l:"d",t:"e",";":"zh",":":"zh",p:"z",b:"i",q:"y",r:"k",k:"l",v:"m",y:"n",j:"o",g:"p",h:"r",c:"s",n:"t",e:"u",a:"f","[":"h","{":"kh",w:"ts",x:"ch",i:"sh",o:"sh",s:"y","'":"e",'"':"e",".":"yu",">":"yu",z:"ya","`":"e","~":"e",m:"","]":"","}":""},r.prototype.toLocalTranslit={1072:"f",1074:"d",1075:"u",1076:"l",1077:"t",1079:"p",1080:"b",1081:"q",1082:"r",1083:"k",1084:"v",1085:"y",1086:"j",1087:"g",1088:"h",1089:"c",1090:"n",1091:"e",1092:"a",1094:"w",1095:"x",1096:"i",1097:"o",1099:"s",1103:"z",1098:"m"},r.prototype.indexIteration=function(){for(var e=Math.min(this.iterEnd,this.iterCur+200),t=this.iterCur;t<e;t++){var a=this.list[t];try{a._order=t}catch(e){}this.add(a)}this.iterCur=t,t>=this.iterEnd?this.callback(this):setTimeout(this.indexIteration.bind(this),10)},r.prototype.strToPrefixes=function(e){for(var t={},a=winToUtf(e).toLowerCase().split(this.delimiter),r=a.length;r--;){var n=a[r],i="";if(n){for(var s=0;s<6;s++){var o=n.charCodeAt(s);if(o){var l=this.toTranslit[o],c=n.substr(s,1);i+=null!=l?l:c}}t[i]=1}}return t},r.prototype.strToSearchPrefixes=function(e){for(var t=[],a=e.toLowerCase().split(this.delimiter),r=a.length;r--;){var n={},i=a[r],s="",o="",l="",c=i.length>1;if(i){for(var d=0;d<6;d++){var u=i.charCodeAt(d);if(u){var _=this.toTranslit[u],g=i.substr(d,1);if(s+=null!=_?_:g,c){var m=this.toLocalCase[g],p=this.toLocalTranslit[u];o+=null!=m?m:g,l+=null!=p?p:g}}}n[s]=1,c&&(n[o]=2,n[l]=3),t.push(n)}}return t},r.prototype.toIndexTree=function(e,t){for(var a=this.index,r=0;r<6;r++){var n=e.substr(r,1)||-1;a=a[n]?a[n]:a[n]=5==r?[]:{}}a.push(t)},r.prototype.remove=function(e){var t=this.prepareFunc(e),a=this.strToPrefixes(t);for(var r in a)if(a.hasOwnProperty(r)){for(var n=this.index,i=0;i<6;i++){var s=r.substr(i,1)||-1;if(!n[s])break;n=n[s]}if(n.length)for(var o in n)if(this.equals(n[o],e)){n.splice(o,1);break}}},r.prototype.equals=function(e,t){for(var a in e)if(e.hasOwnProperty(a))switch(typeof e[a]){case"object":if(!this.equals(e[a],t[a]))return!1;break;case"function":if(void 0===e[a]||e[a].toString()!=t[a].toString())return!1;break;default:if(e[a]!=t[a])return!1}for(var r in t)if(void 0===t[r])return!1;return!0},r.prototype.intersect=function(e,t){var a=[];if(isNumeric(e[0])||isNumeric(t[0]))return e.filter((function(e){return-1!==t.indexOf(e)}));for(;e.length>0&&t.length>0;)e[0]._order<t[0]._order?e.shift():(e[0]._order>t[0]._order||this.equals(e[0],t[0])&&a.push(e.shift()),t.shift());return a},r.prototype.add=function(e){var t=this.prepareFunc(e),a=this.strToPrefixes(t);for(var r in a)a.hasOwnProperty(r)&&this.toIndexTree(r,e)},r.prototype.search=function(e){var t=this.index,a=this.strToSearchPrefixes(e),r=[],n=!1;for(var i in a)if(a.hasOwnProperty(i)){if(n&&!r)break;var s=this.localSearch(a[i],0,t);s.sort((function(e,t){return e._order-t._order})),r=n?this.intersect(r,s):s,n=!0}for(var o=r[0],l=r.length+1,c=[],d=1;d<l;d++){var u=r[d];u!=o&&(c.push(o),o=u)}return c},r.prototype.localSearch=function(e,t,a){if(!a)return[];var r={};for(var n in e)if(e.hasOwnProperty(n)){var i=n.substr(t,1)||-1;r[i]||(r[i]={}),r[i][n]=1}if(6==t++||!a)return a;var s=[];for(var o in r)if(-1==o)for(var l in a)a.hasOwnProperty(l)&&s.push.apply(s,this.localSearch(r[o],t,a[l]));else{var c=this.localSearch(r[o],t,a[o]);s.push.apply(s,c)}return s}},667784:(e,t,a)=>{"use strict";a.d(t,{addDelegateEvent:()=>o,removeDelegateEvent:()=>l});a(530522),a(66108),a(579665),a(95767),a(991181),a(296253),a(751876);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var i=new window.Map;function s(e){var t=i.get(e.currentTarget);if(t){var a=t[e.type];if(a)for(var n,s=0;s<a.length;s++){var o=r(a[s],2),l=o[0],c=o[1],d=void 0;if(hasClass(e.target,l)?d=c(e,e.target):(n=gpeByClass(l,e.target,e.currentTarget))&&(d=c(e,n)),!1===d)break}}}function o(e,t,a,r,n){var o=i.get(e);o||(i.set(e,{}),o=i.get(e));for(var l=t.split(" "),c=0;c<l.length;c++){var d=l[c];o[d]||(o[d]=[],n?addEvent(e,d,s,!1,!1,n):addEvent(e,d,s)),o[d].push([a,r])}}function l(e,t,a,r){var n=i.get(e);n&&(t.split(" ").forEach((t=>{n[t]&&(n[t]=n[t].filter((e=>e[0]!==a||e[1]!==r)),0===n[t].length&&removeEvent(e,t,s))})),0===Object.keys(n).map((e=>n[e].length)).reduce(((e,t)=>e+t))&&i.delete(e))}},582744:(e,t,a)=>{"use strict";a.d(t,{MAX_DEVIATION:()=>s,EXPIRING_TIME:()=>o,EXPIRING_SOON_TIME:()=>l,EXPIRING:()=>c,EXPIRING_SOON:()=>d,EXPIRED:()=>u,casperMessagesStore:()=>h});a(530522),a(66108),a(296253),a(991181),a(579665),a(95767);var r=a(294940);function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var a=[],r=!0,n=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(a.push(s.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(a);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var s=2e3,o=6e4,l=1e4,c="expiring",d="expiring_soon",u="expired",_=[],g={},m={},p=0,h={add(e){var t=n(v(e),3),a=t[0],r=t[1],i=t[2],s=Math.max(a+r-o-i,0),_=Math.max(a+r-l-i,0),p=Math.max(a+r-i,0),h=setTimeout((()=>{f({type:c,message:e})}),s),b=setTimeout((()=>{f({type:d,message:e})}),_),C=setTimeout((()=>{f({type:u,message:e}),m[e.chat_local_id]=!0,delete g[e.chat_local_id]}),p);g[e.chat_local_id]={message:e,expiringTime:s,expiredTime:p,timers:[h,b,C]}},remove(e){this.has(e)&&(g[e].timers.forEach(clearTimeout),delete g[e])},setTimeshift(e){p=1e3*(e||0)},getTimings:e=>g[e]?v(g[e].message):[0,0,0],getExpireTime(e){if(!g[e])return 0;var t=n(v(g[e].message),3),a=t[0],r=t[1],i=t[2];return Math.max(Math.floor((a+r-i)/1e3),0)},isProcessed:e=>!!m[e],subscribe(e){_.push(e)},unsubscribe(e){_=_.filter((t=>t!==e))},has:e=>!!g[e],destroy(){g={},_=[],m={}}};function f(e){_.forEach((t=>t(e)))}function v(e){return[1e3*e.date+p,1e3*((0,r.getMessageTTL)(e)||0),Date.now()]}},980309:(e,t,a)=>{"use strict";a.d(t,{getNativeOption:()=>n,createScroll:()=>l});var r=a(610124);function n(e,t){return bodyNode[e]||document.documentElement[e]}class i{constructor(e,t){this.el=e,this.opts=t,this.module=(0,r.createModule)({handlers:(e,t)=>{e(window,"scroll",this.onScroll.bind(this)),e(window,"resize",this.resize.bind(this))}}),this.innerHeight=window.innerHeight,this.prevScroll=this.scrollTop()}update(){}resize(){this.innerHeight=window.innerHeight}scrollTop(e){if(void 0===e)return n("scrollTop",this.el);!function(e,t,a){"scrollTop"===e&&window.scrollTo(0,t)}("scrollTop",e,this.el)}contHeight(){return n("scrollHeight")}smoothScroll(e){scrollToY(e+this.scrollTop(),300)}getContainer(){return this.el}getScroller(){return null}scrollBottom(e){if(void 0===e)return this.contHeight()-this.scrollTop()-this.getScrollHeight();var t=this.contHeight()-e-this.getScrollHeight();this.scrollTop(t)}scrollBottomFixSave(e){var t=Date.now(),a=()=>{Date.now()-t<500&&this.scrollBottom(e),window.removeEventListener("scroll",a)};window.addEventListener("scroll",a),this.scrollBottom(e)}onScroll(e){var t=this.scrollTop(),a=t-this.prevScroll,r=this.contHeight();this.opts.onScroll&&this.opts.onScroll(-a,this),this.opts.scrollChange&&this.opts.scrollChange(t),this.opts.more&&r-t<2*this.innerHeight&&this.opts.more(this),this.prevScroll=t}getScrollHeight(){return this.innerHeight}destroy(){(0,r.destroyModule)(this.module)}}class s{constructor(e,t){this.prevTop=0,this.scroll=new uiScroll(e,{hidden:void 0===t.hidden||t.hidden,shadows:t.shadows,stopScrollPropagation:!1,theme:t.scrollTheme,onmore:()=>t.more&&t.more(this),onscroll:e=>{var a=this.scrollTop(),r=this.prevTop-a;this.prevTop=a,t.scrollChange&&t.scrollChange(a),t.onScroll&&t.onScroll(r,this)}})}update(){this.scroll.update("sync")}scrollTop(e){return void 0!==e?this.scroll.scrollTop(e):this.scroll.data.scrollTop}getContainer(){return this.scroll.content}getScroller(){return this.scroll.scroller}contHeight(){return this.scroll.data.scrollHeight}smoothScroll(e){this.scroll.scrollTop(this.scrollTop()+e,300)}scrollBottom(e){return void 0!==e?this.scroll.scrollBottom(e):this.scroll.data.scrollBottom}scrollBottomFixSave(e){var t=Date.now();this.scroll.emitter.addOnceListener("resize",(()=>{Date.now()-t<500&&this.scroll&&this.scrollBottom(e)})),this.scrollBottom(e)}getScrollHeight(){return this.scroll.data.viewportHeight}destroy(){this.scroll.destroy()}}class o{constructor(e,t){this.el=e}update(){}getContainer(){return this.el}getScroller(){return null}scrollTop(e){return 0}contHeight(){return 0}smoothScroll(e){}scrollBottom(e){return 0}scrollBottomFixSave(e){}getScrollHeight(){return 0}destroy(){}}function l(e,t){return t.noScroll?new o(e):t.nativeScroll?new i(e,t):new s(e,t)}},612202:(e,t,a)=>{"use strict";a.d(t,{statlogsValueEvent:()=>n,statlogsProbValueEvent:()=>i});var r=a(19331);function n(e,t,a,r,n){return window.statlogsValueEvent(e,t,a,r,n)}function i(e,t,a,i,s,o){(0,r.randEnabled)(e)&&n(t,a,i,s,o)}},418793:(e,t,a)=>{"use strict";a.d(t,{Scroll:()=>o});a(95767),a(991181),a(296253);var r=a(667294),n=a(32821),i=a(980309);a(45697);function s(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)a=i[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)a=i[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var o=e=>{var t=e.children,a=s(e,["children"]);return r.createElement(n.ScrollContext.Provider,{value:{createScroll:i.createScroll}},r.createElement(n.Scroll,a,t))};o.defaultProps={isNative:!1,isShadows:!1,neverHide:!1,onScroll:null}},153215:(e,t,a)=>{"use strict";a.d(t,{CustomStatCollector:()=>i});var r=a(66433),n=a(171516),i=function(){function e(){}return e.prototype.getCurrentTime=function(e){void 0===e&&(e=!0);var t=Date.now().toString(10);return e?t+"000":t},e.prototype.getIntId=function(){return Math.floor(Math.random()*e.MAX_INT32)},e.prototype.getBaseEvent=function(){return{id:this.getIntId(),timestamp:this.getCurrentTime()}},e.prototype.logEvent=function(e){e.type&&e[e.type]?(0,n.saveCustomStats)(e):(0,r.logError)(new Error("CustomStatCollector: invalid event."))},e.MAX_INT32=2147483647,e}()},482278:(e,t,a)=>{"use strict";a.d(t,{DevNullStatCollector:()=>i});var r=a(570655),n=a(83426),i=function(){function e(e){this.customStatCollector=e}return e.prototype.logEvent=function(e){var t,a=(0,r.__assign)((0,r.__assign)({},this.customStatCollector.getBaseEvent()),((t={type:n.CustomStatEventTypes.TYPE_DEV_NULL_ITEM})[n.CustomStatEventTypes.TYPE_DEV_NULL_ITEM]=e,t));this.customStatCollector.logEvent(a)},e}()},414332:(e,t,a)=>{"use strict";a.d(t,{CustomStatCollector:()=>r.CustomStatCollector,DevNullStatCollector:()=>n.DevNullStatCollector});var r=a(153215),n=a(482278)},83426:(e,t,a)=>{"use strict";var r;a.d(t,{CustomStatEventTypes:()=>r}),function(e){e.TYPE_DEV_NULL_ITEM="type_dev_null_item"}(r||(r={}))},826338:(e,t,a)=>{"use strict";a.d(t,{convertKludgesToAttaches:()=>u,isReservedPeer:()=>_,isVkAdminPeer:()=>g,isSupportAgentPeer:()=>m,isUserPeer:()=>p,isChatPeer:()=>h,isEmailPeer:()=>f,isContactPeer:()=>v,isCommunityPeer:()=>b,convertAttachesToPhpMedia:()=>C,isPinnedSortId:()=>E,isOnboardingFindFriendsLink:()=>y});var r=a(570655),n=a(40906),i=a(251976),s=a(961540);function o(e,t){void 0===t&&(t=[]);var a=(0,r.__read)(e.split("_"),2);return[a[0],a[1],t]}function l(e,t,a,n){if(void 0===a&&(a=0),void 0===n&&(n=0),n>50)return[[],e.length];for(var i=[],s="";a<e.length;){var c=e[a];if("id"===c)s=t[a];else if(","===c&&s)i.push(o(s)),s="";else if("("===c){var d=(0,r.__read)(l(e,t,a+1,n+1),2),u=d[0];a=d[1],i.push(o(s,u)),s=""}else if(")"===c)return""!==s&&i.push(o(s)),[i,a];a++}return s&&i.push(o(s)),[i,a]}var c={};function d(e){if(c[e])return c[e];for(var t=e?e.length:0,a=[],n=[],i="",s=0;s<t;s++){var o=e[s],d=o.charCodeAt(0);d>=48&&d<=57||"_"===o||"-"===o?i+=o:"("!==o&&")"!==o&&":"!==o&&","!==o||(""!==i&&(n.push(i),a.push("id"),i=""),n.push(o),a.push(o))}i.length>0&&(n.push(i),a.push("id"));var u=(0,r.__read)(l(a,n),1)[0];return Object.keys(c).length>300&&(c={}),c[e]=u,u}function u(e,t){var a=[];e.fwd_count?a.push({type:"mail",id:-t,object:{fwd_count:e.fwd_count}}):e.fwd&&a.push({type:"mail",id:-t,object:{fwd_count:d(e.fwd).length}});for(var r=1;e["attach"+r+"_type"];++r)switch(e["attach"+r+"_type"]){case"call":a.push({type:e["attach"+r+"_type"],id:e["attach"+r],initiatorId:(0,n.intval)(e["attach"+r+"_call_initiator_id"]),state:e["attach"+r+"_call_state"],duration:(0,n.intval)(e["attach"+r+"_call_duration"]),receiverId:(0,n.intval)(e["attach"+r+"_call_receiver_id"])});break;case"doc":if("audiomsg"===e["attach"+r+"_kind"]){var i=e.attachments?JSON.parse(e.attachments)[0]:{};a.push({type:e["attach"+r+"_type"],kind:"audio_message",id:e["attach"+r],audio_message:i.audio_message});break}default:a.push({type:e["attach"+r+"_type"],id:e["attach"+r],kind:e["attach"+r+"_kind"],productId:e["attach"+r+"_product_id"]})}return e.geo&&a.push({type:"geo",id:e.geo}),a}function _(e){return 0==e}function g(e){return 100===e}function m(e){return 333===e}function p(e){return e>0&&e<2e9}function h(e){return e>2e9}function f(e){return e<-2e9}function v(e){return e>19e8&&e<2e9}function b(e){return e>-2e9&&e<0}function C(e){return e.map((function(e){var t="audiomsg"===e[2]?"audio_message":e[2];return e[0]+":"+e[1]+":"+t})).join(",")}function E(e){return e>0&&(e|i.PINNED_CONVERSATION_BIT_MASK)===i.PINNED_CONVERSATION_BIT_MASK}function y(e){return new RegExp("(^(https?:\\/\\/)?([a-z0-9_\\-.]+\\.)?"+s.VK_SITE_REGEX_SOURCE_UNSAFE+")?\\/onboarding_find_friends").test(decodeURIComponent(e))}},375053:(e,t,a)=>{"use strict";a.d(t,{getMessageFromTuple:()=>s,hasUserMentions:()=>o});var r=a(570655),n=a(522925),i=a(826338),s=function(e){var t=(0,r.__read)(e,10),a=t[0],s=t[1],o=t[2],l=t[3],c=t[4],d=t[5],u=t[6],_=t[7],g=t[8],m=t[9],p=Object.assign({},d||{},u||{});return Array.isArray(p.marked_users)&&(p.marked_users=p.marked_users.filter((function(e){return Object.values(n.MARKED_TYPE).includes(e[0])}))),{messageId:a,flags:s,peerId:o,date:l,attaches:(0,i.convertKludgesToAttaches)(p,a),subject:p.title||"",text:c,kludges:p,randomId:_,userId:(0,i.isChatPeer)(o)?Number(p.from)||0:o,update_time:m,chat_local_id:g}};function o(e,t){return!!e.kludges&&(e.kludges.marked_users||[]).some((function(e){if(e[0]!==n.MARKED_TYPE.MENTIONS)return!1;switch(e[1]){case"all":return!0;case"online":return e[2].includes(t);default:return e[1].includes(t)}}))}},663825:(e,t,a)=>{"use strict";a.d(t,{constructEvent:()=>s,SET_FLAGS:()=>l,REPLACE_FLAGS:()=>c,RESET_FLAGS:()=>d,ADD_MESSAGE:()=>u,READ_INBOUND:()=>_,READ_OUTBOUND:()=>g,READ_INBOUND_BY_CMID:()=>m,READ_OUTBOUND_BY_CMID:()=>p,CHAT_CHANGED:()=>h,CONVERSATION_UPDATED:()=>f,TYPING:()=>v,RECORDING_AUDIO:()=>b,VIDEO_CALL:()=>C,UNREAD_COUNT:()=>E,NOTIFY_SETTINGS_CHANGED:()=>y,KEYBOARD_CALLBACK_RECEIVED:()=>T,EMPTY:()=>I,RESET_DIRECTORIES:()=>A,REPLACE_DIRECTORIES:()=>L,SET_DIRECTORIES:()=>S,RESYNC:()=>k,REFRESH_LP_KEY:()=>M,TRANSITION:()=>N,RESET_PEER:()=>w,MUTEX:()=>P,CHANGE_PEER:()=>O,CHANGE_TAB:()=>R,FAILED_MESSAGE:()=>D,RESEND:()=>F,DELETE_DIALOG:()=>x,EDIT_MESSAGE:()=>H,REPLACE_MESSAGE:()=>U,INVALIDATE_MESSAGE:()=>B,WAITING_FOR_RECONNECT:()=>j,RECONNECTING:()=>q,RECONNECTED:()=>V,CONVO_MAJOR_ID_CHANGED:()=>Y,CONVO_MINOR_ID_CHANGED:()=>$,PEER_TAGS_CHANGED_EVENT:()=>K,PEER_PROFILE_TAGS_CHANGED_EVENT:()=>W,FLAG_OUTBOUND:()=>Q,FLAG_IMPORTANT:()=>J,FLAG_SPAM:()=>X,FLAG_DELETED:()=>Z,FLAG_STEALTH:()=>ee,FLAG_HAS_REPLY:()=>te,FLAG_AUDIO_MESSAGE_LISTENED:()=>ae,FLAG_DELETE_BY_TTL:()=>re,FOLDER_IMPORTANT:()=>ne,FOLDER_HAS_BANNER:()=>ie,FOLDER_AD_TAG:()=>se,MAIL_CHAT_UPDATE_TYPE_TITLE_CHANGED:()=>oe,MAIL_CHAT_UPDATE_TYPE_AVATAR_CHANGED:()=>le,MAIL_CHAT_UPDATE_TYPE_ADMIN_GRANTED:()=>ce,MAIL_CHAT_UPDATE_TYPE_FLAGS_CHANGED:()=>de,MAIL_CHAT_UPDATE_TYPE_PINNED:()=>ue,MAIL_CHAT_UPDATE_TYPE_USER_JOINED:()=>_e,MAIL_CHAT_UPDATE_TYPE_USER_LEFT:()=>ge,MAIL_CHAT_UPDATE_TYPE_USER_KICKED:()=>me,MAIL_CHAT_UPDATE_TYPE_ADMIN_KICKED:()=>pe,MAIL_CHAT_UPDATE_TYPE_BANNER_CHANGED:()=>he,MAIL_CHAT_UPDATE_TYPE_KEYBOARD_CHANGED:()=>fe,MAIL_CHAT_UPDATE_TYPE_MESSAGE_REQUEST_CHANGED:()=>ve,MAIL_CHAT_UPDATE_TYPE_CONTACT_CONVERTED:()=>be,MAIL_CHAT_UPDATE_TYPE_BUSINESS_NOTIFY_DATA_CHANGED:()=>Ce,MAIL_CHAT_UPDATE_TYPE_CALL_IN_PROGRESS_CHANGED:()=>Ee,MAIL_CHAT_UPDATE_TYPE_IS_NEW_CHANGED:()=>ye,MESSAGE_REQUEST_STATUS_ACCEPTED:()=>Te,MESSAGE_REQUEST_STATUS_REJECTED:()=>Ie,MESSAGE_REQUEST_STATUS_NEW:()=>Ae,readInboundEvent:()=>Se,resetDirectoriesEvent:()=>ke,setDirectoriesEvent:()=>Me,readInboundByCmidEvent:()=>Ne,resyncEvent:()=>we,mutexEvent:()=>Pe});var r=a(570655),n=a(375053),i=a(40906);function s(e){switch(e[0]){case 0:return t=e,a=(0,r.__read)(t,2)[1],{type:o,localId:a};case 1:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:c,messageId:a,mask:n,peerId:i}}(e);case 2:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:l,messageId:a,flags:n,peerId:i}}(e);case 3:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:d,messageId:a,flags:n,peerId:i}}(e);case 4:return function(e){var t=(0,r.__read)(e,12),a=t[1],i=t[2],s=t[3],o=t[4],l=t[5],c=t[6],d=t[7],_=t[8],g=t[9],m=t[10],p=t[11];return(0,r.__assign)((0,r.__assign)({type:u},(0,n.getMessageFromTuple)([Number(a),Number(i),Number(o),Number(l),c,d,_,g,m,p])),{minorSortId:s})}(e);case 5:return Le(e);case 6:return Se(e);case 7:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:g,peerId:a,upToId:n,unread:i}}(e);case 10:return ke(e);case 11:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:L,peerId:a,mask:n}}(e);case 12:return Me(e);case 13:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:x,peerId:a,localId:n}}(e);case 18:return function(e){var t=(0,r.__read)(e,11),a=t[1],i=t[2],s=t[3],o=t[4],l=t[5],c=t[6],d=t[7],u=t[8],_=t[9],g=t[10];return(0,r.__assign)({type:U},(0,n.getMessageFromTuple)([Number(a),Number(i),Number(s),Number(o),l,c,d,u,_,g]))}(e);case 19:return function(e){var t=(0,r.__read)(e,2)[1];return{type:B,messageId:t}}(e);case 20:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:Y,peerId:a,majorId:n}}(e);case 21:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:$,peerId:a,minorId:n}}(e);case 23:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:K,peerId:a,peerTagsMask:n}}(e);case 51:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:h,chatId:a,self:n}}(e);case 52:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:f,peerId:n,updateType:a,updateArg:i}}(e);case 63:return function(e){var t=(0,r.__read)(e,5),a=t[1],n=t[2],i=t[3],s=t[4];return{type:v,peerId:a,userIds:n,totalCount:i,ts:s}}(e);case 64:return function(e){var t=(0,r.__read)(e,5),a=t[1],n=t[2],i=t[3],s=t[4];return{type:b,peerId:a,userIds:n,totalCount:i,ts:s}}(e);case 70:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:C,userId:a,callId:n}}(e);case 80:return function(e){var t=(0,r.__read)(e,10),a=t[1],n=t[2],i=t[3],s=t[4],o=t[5],l=t[6],c=t[7],d=t[8],u=t[9];return{type:E,count:a,countNotMuted:n,showOnlyNotMuted:i,businessNotifyUnread:s,headerTotalUnread:o,headerNotMutedUnread:l,archiveUnreadCount:c,archiveUnreadUnmutedCount:d,archiveMentionsCount:u}}(e);case 114:return function(e){var t=(0,r.__read)(e,2)[1]||{},a=t.peer_id,n=t.sound,i=t.disabled_until;return{type:y,peerId:a,sound:n,disabledUntil:i}}(e);case 115:return function(e){var t=(0,r.__read)(e,2)[1];return{type:z,payload:t}}(e);case 116:return function(e){var t=(0,r.__read)(e,2)[1]||{},a=t.id,n=t.flags,i=t.peer_id,s=t.date,o=t.message,l=t.kludges,c=t.random_id,d=t.chat_local_id,u=t.update_time,_=t.title;return Le([5,a,n,i,s,o,Object.assign({},l||{},{title:_||""}),{},c,d,u])}(e);case 117:return function(e){var t=(0,r.__read)(e,2)[1]||{},a=t.uuid,n=t.device_name;return{type:G,uuid:a,deviceName:void 0===n?"":n}}(e);case 119:return function(e){var t=(0,r.__read)(e,2)[1],a=t.event_id,n=t.owner_id,i=t.peer_id,s=t.action;return{type:T,event_id:a,owner_id:n,peer_id:i,action:s}}(e);case 120:return{type:W};case 10006:return Ne(e);case 10007:return function(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:p,peerId:a,upToCmid:n,unread:i}}(e);case-1:return we();case-2:return function(e){var t=(0,r.__read)(e,3),a=t[1],n=t[2];return{type:M,key:a,url:n}}(e);case-3:return function(e){var t=(0,r.__read)(e,2)[1];return{type:j,timeout:t}}(e);case-4:return{type:q};case-5:return{type:V};default:return function(e){return{type:I,params:e}}(e)}var t,a}var o="event_delete",l="event_set_flags",c="event_replace_flags",d="event_reset_flags",u="event_add_message",_="event_read_inbound",g="event_read_outbound",m="event_read_inbound_by_cmid",p="event_read_outbound_by_cmid",h="event_chat_changed",f="event_chat_updated",v="event_typing",b="event_recoding_audio",C="event_video_call",E="event_unread_count",y="event_notify_settings_changed",T="event_keyboard_callback_received",I="event_empty",A="event_reset_directories",L="event_replace_directories",S="event_set_directories",k="event_resync",M="event_refresh_lp_key",N="transition_event",w="reset_peer",P="mutex",O="change_peer",R="event_change_tab",D="event_failed_message",F="event_resend",x="event_delete_dialog",H="event_edit_message",U="event_replace_message",B="event_invalidate_event",G="event_audio_start",j="event_waiting_for_reconnect",q="event_reconnecting",V="event_reconnected",z="incoming_call",Y="event_convo_major_id_changed",$="event_convo_minor_id_changed",K="peer_tags_changed",W="peer_profile_tags_changed",Q=2,J=8,X=64,Z=128,ee=65536,te=1<<21,ae=4096,re=1<<22,ne=1,ie=8,se=32768,oe=1,le=2,ce=3,de=4,ue=5,_e=6,ge=7,me=8,pe=9,he=10,fe=11,ve=12,be=13,Ce=14,Ee=19,ye=22,Te=1,Ie=2,Ae=3;function Le(e){var t=(0,r.__read)(e,11),a=t[1],i=t[2],s=t[3],o=t[4],l=t[5],c=t[6],d=t[7],u=t[8],_=t[9],g=t[10];return(0,r.__assign)({type:H},(0,n.getMessageFromTuple)([Number(a),Number(i),Number(s),Number(o),l,c,d,u,_,g]))}function Se(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:_,peerId:a,upToId:n,unread:i}}function ke(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:A,peerId:a,mask:n,local:void 0!==i&&i}}function Me(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:S,peerId:a,mask:n,local:void 0!==i&&i}}function Ne(e){var t=(0,r.__read)(e,4),a=t[1],n=t[2],i=t[3];return{type:m,peerId:a,upToCmid:n,unread:i}}function we(){return{type:k}}function Pe(e){var t=(0,r.__read)(e,6),a=t[1],n=t[2],s=t[3],o=t[4],l=t[5];return{type:P,free:!!(0,i.intval)(a)||(0,i.intval)(o)===window.vk.id,resource:n,peerId:(0,i.intval)(s),who:(0,i.intval)(o),name:l}}},522925:(e,t,a)=>{"use strict";var r;a.d(t,{MARKED_TYPE:()=>r}),function(e){e[e.MENTIONS=1]="MENTIONS",e[e.CASPER=2]="CASPER"}(r||(r={}))},940441:(e,t,a)=>{"use strict";a.d(t,{customMetricsCollector:()=>n});var r=a(214547),n=new(function(){function e(){this.productionStatCollector=new r.ProductionStatCollector,this.actionStatCollector=new r.ActionStatCollector(this.productionStatCollector)}return e.prototype.logEvent=function(e){return this.actionStatCollector.logEvent({type:"type_ab_custom_metrics_item",type_ab_custom_metrics_item:e})},e}())},724702:(e,t,a)=>{"use strict";a.d(t,{messagingActionItemStatCollector:()=>n});var r=a(214547),n=new(function(){function e(){this.productStatCollector=new r.ProductionStatCollector,this.actionStatCollector=new r.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e){var t={type:"type_messaging_action_item",type_messaging_action_item:e};this.actionStatCollector.logEvent(t)},e}())},746133:(e,t,a)=>{"use strict";a.d(t,{audioMessageStatCollector:()=>n});var r=a(214547),n=new(function(){function e(){this.productStatCollector=new r.ProductionStatCollector,this.actionStatCollector=new r.ActionStatCollector(this.productStatCollector)}return e.prototype.logEvent=function(e){var t={type:"type_messaging_audio_message_item",type_messaging_audio_message_item:e};this.actionStatCollector.logEvent(t)},e}())},676554:(e,t,a)=>{"use strict";a.d(t,{ContactRecommendationCollector:()=>i});var r=a(740517),n=a(214547),i=new(function(){function e(){this.productionStatCollector=new n.ProductionStatCollector,this.clickStatCollector=new n.ClickStatCollector(this.productionStatCollector),this.actionStatCollector=new n.ActionStatCollector(this.productionStatCollector)}return e.prototype.logEvent=function(e){switch(e.event_type){case"click":var t={type:"type_messaging_contact_recommendations_item",position:e.position,type_messaging_contact_recommendations_item:e},a={type:r.EventItemType.TYPE_MESSAGING_CONTACT_RECOMMENDATIONS_ITEM};return this.clickStatCollector.logEvent(t,a);case"show":case"hide":t={type:"type_messaging_contact_recommendations_item",type_messaging_contact_recommendations_item:e};return this.actionStatCollector.logEvent(t)}},e}())},722088:(e,t,a)=>{"use strict";a.d(t,{replaceHyperLinks:()=>o,replaceEmailLinks:()=>l,replaceMentions:()=>c,replaceMassMentions:()=>d,replaceHashtags:()=>g,linksReplacer:()=>m});var r,n=a(254692),i=a(695724),s=a(251976);function o(e,t){for(var a,r=0,i=e;null!==(a=n.MESSAGE_REGEXP.exec(e));){var s=(a=u(a))[0].length,o=a.index+s,l=e[a.index-1],c=e[o-1],d=void 0!==l&&/([\w\$А-Яа-яёЁєЄҐґЇїІіЈј\—\-\_@;.])/i.test(l),g=void 0!==c&&/([:;$])/i.test(c);if(!d&&!g){var m=_(a),p=m.domain.toLowerCase();if(p.length<=n.MAX_DOMAIN_LENGTH&&n.TOP_DOMAINS.includes(p)){var h=t(m);i=i.slice(0,a.index+r)+h+i.slice(o+r),r+=h.length-s}}}return i}function l(e,t){return e.replace(n.EMAIL,t||function(e){return'<a href="mailto:'+e+'">'+e+"</a>"})}function c(e,t){return e.replace(n.MENTION,t||function(e,t,a,r,n){return'<a href="/'+(t+a)+'" class="mem_link" mention="'+(0,i.clean)(r||"")+'" mention_id="'+(0,i.clean)(t+a)+'" onclick="return mentionClick(this, event)" onmouseover="mentionOver(this)">'+n+"</a>"})}function d(e,t){return e.replace(s.MASS_MENTION_REGEXP,(function(e){return t?t(e,"","",e,e):'<span class="mem_pseudolink" data-mention="'+e.slice(1).toLowerCase()+'">'+e+"</span>"}))}function u(e){if(!e[0]||!e[6])return e;var t=e[0].length-1,a=e[6].length-1;return"."===e[0][t]&&"."===e[6][a]&&(e[0]=e[0].slice(0,t),e[6]=e[6].slice(0,a)),e}function _(e){return{full:e[0],protocol:e[1]||"http://",url:e[2],domain:e[4],query:e[6]||""}}function g(e,t){return e.replace((r||(r=new RegExp(n.RE_HASHTAG_EXTRACTION_PATTERN,"ig")),r),(function(e,a,r,n,i){return(a||"")+t(r+(i||""))}))}function m(e,t){var a=t.url,r=t.full,s=t.protocol,o=t.query;try{r=decodeURIComponent(r)}catch(e){}if(r.length>55&&(r=r.substr(0,53)+".."),r=(0,i.clean)(r).replace(/&amp;/g,"&"),!e&&a.match(n.OUR_DOMAINS)){var l=a=(0,i.replaceEntities)(a).replace(n.ENTITIES,encodeURIComponent),c=a.indexOf("#/"),d="";c>=0?l=a.substr(c+1):(c=a.indexOf("#!"))>=0&&(l="/"+a.substr(c+2).replace(/^\//,""));var u=l.match(n.VK_DOMAIN);return u&&u[1].length<32&&(d=' mention_id="'+u[1]+'" onclick="return mentionClick(this, event)" onmouseover="mentionOver(this)"'),'<a href="'+function(e){return e.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(s+a+o)+'" target="_blank" rel="noopener"'+d+">"+r+"</a>"}var _=(0,i.replaceEntities)(a+o).toString();return'<a href="'+("away.php?utf=1&to="+encodeURIComponent(s+_))+'" target="_blank" rel="noopener" onclick="'+("return goAway('"+(0,i.clean)((s+a+o).replace(/'/g,"\\'"))+"', {}, event);")+'">'+r+"</a>"}},610124:(e,t,a)=>{"use strict";a.d(t,{createMutations:()=>s,createModule:()=>c,destroyModule:()=>d});var r=a(570655),n=a(667784),i=a(49535);function s(e){return{callMutations:function(){if("function"==typeof e)throw console.trace(),new Error("Mutations are not initialized");return e},bindMutations:function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];if("function"!=typeof e)throw console.trace(),new Error("Mutations are already initialized");return e=e.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(t)))}}}function o(e,t,a,r){(0,i.addEvent)(t,a,r),e._registeredHandlers.push({handlerType:"bind",elem:t,types:a,handler:r})}function l(e,t,a,r,i,s){(0,n.addDelegateEvent)(t,a,r,i,s),e._registeredHandlers.push({handlerType:"delegate",elem:t,types:a,selector:r,handler:i})}function c(e){var t={_registeredHandlers:[]};return e.handlers((function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return o.apply(void 0,(0,r.__spreadArray)([t],(0,r.__read)(e)))}),(function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return l.apply(void 0,(0,r.__spreadArray)([t],(0,r.__read)(e)))})),t}function d(e){e._registeredHandlers.forEach((function(e){var t=e.handlerType,a=e.elem,r=e.types,s=e.handler;"delegate"===t?(0,n.removeDelegateEvent)(a,r,e.selector,s):(0,i.removeEvent)(a,r,s)})),e._registeredHandlers=[]}},283303:(e,t,a)=>{"use strict";a.d(t,{updateLocation:()=>n,updateLazyLocation:()=>i});var r=a(695724);function n(e){var t=(0,r.extend)({},window.nav.objLoc,e);Object.keys(t).filter((function(e){return""===t[e]})).forEach((function(e){delete t[e]}));var a=window.nav.toStr(t);window.nav.setLoc(a)}function i(){var e={};return{scheduleNav:function(t){e=(0,r.extend)(e,t)},commitNav:function(){n(e),e={}},scheduleNavWithTimeOut:function(t,a){void 0===a&&(a=100),e=(0,r.extend)(e,t),setTimeout((function(){n(e),e={}}),a)}}}},145072:(e,t,a)=>{"use strict";a.d(t,{MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_INVITE:()=>d,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_CHANGE_STYLE:()=>u,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_PIN:()=>_,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_CHANGE_TITLE:()=>g,MAIL_CHAT_FLAG_ADMINS_CAN_ADD_ADMINS:()=>m,MAIL_CHAT_FLAG_SERVICE_CHAT:()=>p,MAIL_CHAT_FLAG_IS_FAKE_CHANNEL:()=>h,MAIL_CHAT_FLAG_IS_BUSINESS_NOTIFY:()=>f,MAIL_CHAT_FLAG_DENY_ANYONE_TO_WRITE:()=>v,MAIL_CHAT_FLAG_IS_CASPER:()=>b,MAIL_CHAT_FLAG_IS_COMMUNITY_CHAT:()=>C,MAIL_CHAT_FLAG_IS_COMMUNITY_CHAT_DELETED:()=>E,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_MASS_MENTION:()=>y,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_MASS_MENTION:()=>T,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_INVITE:()=>I,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_CHANGE_TITLE:()=>A,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_PIN:()=>L,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_SEE_INVITE_LINK:()=>S,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_SEE_INVITE_LINK:()=>k,MAIL_CHAT_FLAG_ONLY_ADMINS_CAN_CALL:()=>M,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_CALL:()=>N,MAIL_CHAT_FLAG_ONLY_OWNER_CAN_CHANGE_STYLE:()=>w,canSeeInviteLink:()=>O,canMassMention:()=>R,canChangeInviteLink:()=>D,canAddAdmin:()=>F,canInviteUser:()=>x,canKickUser:()=>H,canPinOrUnpin:()=>U,canStartGroupCall:()=>B,canChangeTitle:()=>G,canSeeAllMessages:()=>j,canSeeSettingsItem:()=>q,canCloseChat:()=>V,isUserAdminInChat:()=>Y,isUserOwnerInChat:()=>$});var r,n,i=a(570655),s=a(826338),o=a(982452),l=a(459554),c=a(993421),d=1,u=2,_=4,g=8,m=16,p=64,h=1024,f=4096,v=16384,b=32768,C=1<<17,E=1<<18,y=1<<19,T=1<<20,I=1<<21,A=1<<22,L=1<<23,S=1<<24,k=1<<25,M=1<<26,N=1<<27,w=1<<31;!function(e){e.SEE_INVITE_LINK="see_invite_link",e.CHANGE_INVITE_LINK="change_invite_link",e.INVITE_USER="invite_user",e.PIN_OR_UNPIN="pin_unpin",e.CHANGE_TITLE="change_title",e.ADD_ADMIN="add_admin",e.MASS_MENTION="mass_mention",e.START_GROUP_CALL="call",e.CHANGE_STYLE="change_style"}(n||(n={}));var P=((r={})[n.CHANGE_INVITE_LINK]=[32,32],r[n.ADD_ADMIN]=[m,m],r[n.SEE_INVITE_LINK]=[S,k],r[n.INVITE_USER]=[d,I],r[n.PIN_OR_UNPIN]=[_,L],r[n.CHANGE_TITLE]=[g,A],r[n.MASS_MENTION]=[y,T],r[n.START_GROUP_CALL]=[M,N],r[n.CHANGE_STYLE]=[u,w],r);function O(e,t,a){return z(e,n.SEE_INVITE_LINK,t,a)}function R(e,t,a){return z(e,n.MASS_MENTION,t,a)}function D(e,t,a){return z(e,n.CHANGE_INVITE_LINK,t,a)}function F(e,t,a,r){var i=(0,o.unpackStore)(e),s=a||i.peer,c=(0,l.getTab)(i,s);return!(!c||!(0,l.isChatConvo)(c))&&(!$(c,t)&&z(e,n.ADD_ADMIN,s,r))}function x(e,t,a){return z(e,n.INVITE_USER,t,a)}function H(e,t,a,r){if(function(e,t){var a=(0,o.unpackStore)(e);return void 0!==a.service&&(a.service&t)>0}(e,1))return!0;var n=(0,o.unpackStore)(e),i=a||n.peer,s=void 0===r?n.viewer_id:r,c=(0,l.getTab)(n,i);return!(!c||!(0,l.isChatConvoWithDetails)(c))&&(!(c.data.kicked&&!c.data.closed)&&(!(0,l.isChannelPeer)(c)&&(!$(c,t)&&(!!$(c,s)||(Y(c,s)||function(e,t){return e.invitedByMe.includes(t)}(c,t))&&!Y(c,t)))))}function U(e,t,a){return z(e,n.PIN_OR_UNPIN,t,a)}function B(e,t,a){return z(e,n.START_GROUP_CALL,t,a)}function G(e,t,a){return z(e,n.CHANGE_TITLE,t,a)}function j(e,t,a){var r=(0,o.unpackStore)(e),n=a||r.viewer_id,i=t||(0,c.getPeer)(e);if(!(0,s.isCommunityPeer)(n))return!0;var d=(0,l.getTab)(e,i);return!(!d||!(0,l.isChatConvoWithDetails)(d))&&!!d.caccess[n]}function q(e,t,a){var r=(0,o.unpackStore)(e),n=a||r.viewer_id,i=t||(0,c.getPeer)(e),s=(0,l.getTab)(e,i);if(!s||!(0,l.isChatConvoWithDetails)(s))return!1;var d=(0,l.isChannelPeer)(s);if(!(0,l.isCommunityChat)(s))return $(s,n)&&!d;var u=(0,l.isChatActive)(s),_=$(s,-r.gid)&&u||Y(s,n)&&u,g=(s.allowedUpdateFlags||[]).filter((function(e){return e!==v}));return _&&g.length>0}function V(e,t,a){var r=(0,o.unpackStore)(e),n=a||r.viewer_id,i=t||(0,c.getPeer)(e),s=(0,l.getTab)(e,i);if(!s||!(0,l.isChatConvoWithDetails)(s))return!1;var d=(0,l.isCommunityChat)(s),u=(0,l.isCommunityChatDeleted)(s),_=(0,l.isChatActive)(s),g=$(s,-r.gid)&&_||Y(s,n)&&_;return d&&!u&&g&&(s.allowedUpdateFlags||[]).includes(v)}function z(e,t,a,r){var s,d,u=(0,o.unpackStore)(e),_=(0,c.isCommunityInterface)(e)?u.id:u.viewer_id,g=void 0===r?_:r,m=void 0===a?u.peer:a,p=(0,l.getTab)(u,m);if(!p||!(0,l.isChatConvo)(p))return!1;var h=(0,l.isChatActive)(p),f=(0,i.__read)(P[t],2),v=f[0],b=f[1],C=b|v,E=(0,l.isChannelPeer)(p),y=$(p,g)&&h,T=y||Y(p,g)&&h;if(E)switch(t){case n.ADD_ADMIN:case n.INVITE_USER:return!1;case n.SEE_INVITE_LINK:return h;default:return(0,c.isCommunityInterface)(u)}if((0,l.isCommunityChat)(p)){if((0,l.isClosedChat)(p))return!1;switch(t){case n.SEE_INVITE_LINK:return(0,l.isServiceChatTab)(p)?h:(0,l.doesChatTabHaveFlag)(p,C)?(0,l.doesChatTabHaveFlag)(p,b)?h:T:y;case n.CHANGE_INVITE_LINK:return y||T;case n.ADD_ADMIN:return(0,l.doesChatTabHaveFlag)(p,C)?T:y;case n.MASS_MENTION:case n.START_GROUP_CALL:return(0,l.isServiceChatTab)(p)?h:!y&&((0,l.doesChatTabHaveFlag)(p,C)?T:h);case n.INVITE_USER:return(0,l.isServiceChatTab)(p)?h:!(y&&!p.isDonutChat)&&("chats"!==(null===(d=null===(s=window.nav)||void 0===s?void 0:s.objLoc)||void 0===d?void 0:d.act)&&((0,l.doesChatTabHaveFlag)(p,C)?T:h));case n.PIN_OR_UNPIN:case n.CHANGE_TITLE:return(0,l.isServiceChatTab)(p)?h:T;default:return!1}}switch(t){case n.CHANGE_INVITE_LINK:return(0,l.doesChatTabHaveFlag)(p,v)?T:y;case n.ADD_ADMIN:return(0,l.doesChatTabHaveFlag)(p,C)?T:y;case n.SEE_INVITE_LINK:return(0,l.doesChatTabHaveFlag)(p,C)?(0,l.doesChatTabHaveFlag)(p,b)?h:T:y;case n.INVITE_USER:case n.PIN_OR_UNPIN:case n.MASS_MENTION:case n.START_GROUP_CALL:case n.CHANGE_TITLE:return(0,l.doesChatTabHaveFlag)(p,C)?(0,l.doesChatTabHaveFlag)(p,v)?T:y:h}return!1}function Y(e,t){return(e.adminIds||[]).includes(t)}function $(e,t){return e.ownerId===t}},459554:(e,t,a)=>{"use strict";a.d(t,{isFullyLoadedTab:()=>_,getTab:()=>g,isChatConvo:()=>m,isUserConvo:()=>p,isChatConvoWithDetails:()=>h,getTabSafe:()=>f,getCurrentTab:()=>v,isTabMarkedUnread:()=>b,tabIsMessageRequest:()=>C,tabIsBusinessNotification:()=>E,tabIsNotImportantMessageRequest:()=>y,tabIsArchived:()=>T,getLocalSortId:()=>I,isVKAgentPeer:()=>A,doesChatTabHaveFlag:()=>S,isChannelPeer:()=>k,isCommunityChat:()=>M,isCommunityChatDeleted:()=>N,isCasperChatTab:()=>w,isBusinessNotifyTab:()=>P,isBusinessNotifyPeer:()=>O,isClosedChat:()=>R,isServiceChatTab:()=>D,canArchiveTab:()=>F,isChatActive:()=>x,isPinnedMessageHidden:()=>H,getRecommendedConvoList:()=>U,isRecommendedConvo:()=>B,isConvoBusinessNotifyEnabled:()=>G,isUserEmptyScreenRich:()=>j,getPinnedMessage:()=>q,canBePinned:()=>V,getConvoInlineMenuActions:()=>z});var r=a(570655),n=a(982452),i=a(179288),s=a(993421),o=a(826338),l=a(145072),c=a(923876),d=a(412827),u=a(597903);function _(e,t){var a=g(e,t);return!(void 0===(null==a?void 0:a.history)||!(null==a?void 0:a.msgs))}function g(e,t){var a=(0,n.unpackStore)(e);return a.tabs&&a.tabs[t]}function m(e){return(0,o.isChatPeer)(e.peerId)}function p(e){return(0,o.isUserPeer)(e.peerId)&&!(0,o.isContactPeer)(e.peerId)}function h(e){return(0,o.isChatPeer)(e.peerId)&&!!e.notifications}function f(e,t){return g(e,void 0===t?0:t)}function v(e){return g(e,(0,s.getPeer)(e))}function b(e){return!!(e.folders&&e.folders&i.FOLDER_MASKS[i.FOLDER_MARKED_UNREAD])}function C(e){return Boolean(e.is_message_request||e.folders&&e.folders&i.FOLDER_MASKS[i.ConvoListFolder.MR]||e.folders&&e.folders&i.FOLDER_MASKS[i.FOLDER_MESSAGE_REQUEST_REJECTED])}function E(e){return!!(e.folders&&e.folders&i.FOLDER_MASKS[i.FOLDER_BUSINESS_NOTIFY])}function y(e){return Boolean(C(e)&&e.folders&&e.folders&i.FOLDER_MASKS[i.FOLDER_NOT_IMPORTANT_MESSAGE_REQUEST])}function T(e){return!!(e.folders&&e.folders&i.FOLDER_MASKS[i.FOLDER_ARCHIVE])}function I(e,t){var a=e.get().msg_local_ids_sort,r=a&&t.lastmsg&&a[t.lastmsg]||0;return r>0?2e9+r:t.minor_sort_id||0}function A(e){return 333==+e}function L(e,t){return!!e.mutedPeers&&e.mutedPeers.includes(t)}function S(e,t){return((e&&e.data&&e.data.flags||0)&t)>0}function k(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_IS_FAKE_CHANNEL)}function M(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_IS_COMMUNITY_CHAT)}function N(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_IS_COMMUNITY_CHAT_DELETED)}function w(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_IS_CASPER)}function P(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_IS_BUSINESS_NOTIFY)}function O(e,t){var a;return!!(null===(a=(0,n.unpackStore)(e).dialog_tabs[i.ConvoListFolder.BUSINESS_NOTIFY])||void 0===a?void 0:a.includes(t))}function R(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_DENY_ANYONE_TO_WRITE)}function D(e){return m(e)&&S(e,l.MAIL_CHAT_FLAG_SERVICE_CHAT)}function F(e){return!(t=e.peerId,100==+t||(0,u.isPeerCurrentUser)(e.peerId)||(0,o.isContactPeer)(e.peerId)||w(e));var t}function x(e){return!e.data.closed&&!e.data.kicked}function H(e){var t=e.pinned&&(0,d.parseMessage)(e.pinned);return!!t&&e.pinHideId===t.chat_local_id}function U(e){return(0,n.unpackStore)(e).recommendationList}function B(e,t){var a=(0,n.unpackStore)(e).recommendationList;return Boolean(a&&a.item_data[t])}function G(e){return!!e.can_send_business_notify}function j(e,t){var a=(0,n.unpackStore)(e),r=g(a,t);return(0,o.isUserPeer)(t)&&!(0,o.isContactPeer)(t)&&!(0,c.isDialogWithYourself)(a.id,t)&&!(0,s.isCommunityInterface)(a)&&!(r&&function(e){return!!p(e)&&Boolean(e.is_deleted)}(r))}function q(e){return e&&m(e)&&e.pinned?(0,d.parseMessage)(e.pinned):null}function V(e,t){var a=(0,n.unpackStore)(e),r=!!t.offset||!!t.lastmsg;return!(0,s.isCommunityInterface)(a)&&r&&!w(t)&&!C(t)&&!T(t)}function z(e,t){var a=(0,n.unpackStore)(e),l=a.active_tab,d=(0,c.getConvoInlineMenuActionData)(t,(0,s.isCommunityInterface)(e)),u=[];switch(l){case i.ConvoListFolder.ALL:case i.ConvoListFolder.UNREAD:case i.ConvoListFolder.ARCHIVE:F(t)&&u.push(T(t)?i.ConvoAction.UNARCHIVE:i.ConvoAction.ARCHIVE),V(e,t)&&u.push((0,o.isPinnedSortId)(t.major_sort_id||0)?i.ConvoAction.UNPIN_CONVO:i.ConvoAction.PIN_CONVO),u.push(L(a,t.peerId)?i.ConvoAction.UNMUTE:i.ConvoAction.MUTE),u.push(i.ConvoAction.CLEAR),m(t)&&x(t)&&u.push(i.ConvoAction.LEAVE);break;case i.ConvoListFolder.BUSINESS_NOTIFY:u.push(L(a,t.peerId)?i.ConvoAction.UNMUTE:i.ConvoAction.MUTE),u.push(i.ConvoAction.LEAVE)}return u.map((function(e){return(0,r.__assign)((0,r.__assign)({},d[e]),{action:e})}))}},578843:(e,t,a)=>{"use strict";a.d(t,{getEmptyFolderEls:()=>o,isEmptyFolder:()=>l,getConvoListFolderCounterDisplayed:()=>c,getConvoListFolderCounterTotal:()=>d,isConvoListFolderHidden:()=>u,getFolderUnreadCount:()=>_,getFolderMentionsCount:()=>g,getFolderInlineMenuActions:()=>m});var r=a(570655),n=a(712439),i=a(179288),s=a(820696);function o(e){var t=(0,n.unpackStore)(e);if(!t.dialog_tabs_all[t.active_tab])return[];switch(t.active_tab){case i.ConvoListFolder.MR:return[{type:"empty_message_requests"}];case i.ConvoListFolder.BUSINESS_NOTIFY:return[{type:"empty_business_notify"}];case i.ConvoListFolder.ARCHIVE:return[{type:"empty_archives"}];default:return[{type:"empty_dialogs"}]}}function l(e){var t,a=(0,n.unpackStore)(e);return!(null===(t=a.dialog_tabs[a.active_tab])||void 0===t?void 0:t.length)}function c(e,t){var a,r,s,o,l,c,d,u,_,g,m=(0,n.unpackStore)(e);switch(t){case i.ConvoListFolder.PEER_TAGS:g=0;break;case i.ConvoListFolder.BUSINESS_NOTIFY:g=null!==(s=null===(r=null===(a=m.dialog_tab_cts)||void 0===a?void 0:a[t])||void 0===r?void 0:r.unread)&&void 0!==s?s:0;break;case i.ConvoListFolder.ARCHIVE:g=null!==(c=null===(l=null===(o=m.dialog_tab_cts)||void 0===o?void 0:o[t])||void 0===l?void 0:l.unread)&&void 0!==c?c:0;break;default:g=null!==(_=null===(u=null===(d=m.dialog_tab_cts)||void 0===d?void 0:d[t])||void 0===u?void 0:u.total)&&void 0!==_?_:0}return Math.min(g,999)}function d(e,t){var a,r,s,o=(0,n.unpackStore)(e);return t===i.ConvoListFolder.PEER_TAGS?0:null!==(s=null===(r=null===(a=o.dialog_tab_cts)||void 0===a?void 0:a[t])||void 0===r?void 0:r.total)&&void 0!==s?s:0}function u(e,t){var a,r,s,o=(0,n.unpackStore)(e);switch(t){case i.ConvoListFolder.BUSINESS_NOTIFY:return!!o.settings.business_notify_folder_hidden||0===d(o,i.ConvoListFolder.BUSINESS_NOTIFY);case i.ConvoListFolder.ARCHIVE:if("number"!=typeof o.settings.archives_folder_hidden)return!1;var l=o.settings.archives_folder_hidden;return(null!==(s=null===(r=null===(a=o.dialog_tab_cts)||void 0===a?void 0:a[i.ConvoListFolder.ARCHIVE])||void 0===r?void 0:r.mentions)&&void 0!==s?s:0)<=l;default:return!1}}function _(e,t){var a=c(e,t);return a?a<100?a.toString():"99+":""}function g(e,t){var a,r,i;return((null!==(i=null===(r=null===(a=(0,n.unpackStore)(e).dialog_tab_cts)||void 0===a?void 0:a[t])||void 0===r?void 0:r.mentions)&&void 0!==i?i:0)||"").toString()}function m(e,t){var a=(0,s.getFolderInlineMenuActionsData)(t),n=[];switch(t){case i.ConvoListFolder.BUSINESS_NOTIFY:case i.ConvoListFolder.ARCHIVE:d(e,t)>0&&u(e,t)&&n.push(i.FolderAction.SHOW)}return n.map((function(e){return(0,r.__assign)({action:e},a[e])}))}},376473:(e,t,a)=>{"use strict";a.d(t,{getMessage:()=>u,getMessageByCmid:()=>_,isMessageStored:()=>g,isVoiceMessageListened:()=>m,isExistingRid:()=>p,getLastMessage:()=>h,getLastMeta:()=>f,getLocalId:()=>v,isOutbound:()=>b,isServiceMsg:()=>C,getPreviousMessage:()=>E,getMessageUserId:()=>y,getMessageAdminId:()=>T,isGraffiti:()=>A,isAudioMsg:()=>L,isSticker:()=>S,isGift:()=>k,isMoney:()=>M,isMoneyRequest:()=>N,isVKPay:()=>w,isCasperMessage:()=>P,isCallMessage:()=>O,isActiveGroupCallMessage:()=>R,isUnread:()=>D,wasEdited:()=>F,hasReply:()=>x,hasForwards:()=>H,isImportant:()=>U,canMessageBeEdited:()=>B,shiftDate:()=>G,isNewStack:()=>j,isMessageToBlockedCommunity:()=>q,isMessageEmpty:()=>V,getMessageTTL:()=>z,isExpiredCasperMessage:()=>Y});var r=a(663825),n=a(712439),i=a(459554),s=a(412827),o=a(993421),l=a(289988),c=a(19331),d=a(375053);function u(e,t,a){var r,n=(0,i.getTab)(e,t),o=null===(r=null==n?void 0:n.msgs)||void 0===r?void 0:r[a];return o?(0,s.parseMessage)(o):null}function _(e,t,a){var r=(0,i.getTab)(e,t);if(!(null==r?void 0:r.msgs))return null;var n=Object.values(r.msgs).find((function(e){return(0,s.parseMessage)(e).chat_local_id===a}));return n?(0,s.parseMessage)(n):null}function g(e,t,a){var r,n=(0,i.getTab)(e,t);return!!(null===(r=null==n?void 0:n.msgs)||void 0===r?void 0:r[a])}function m(e){return Boolean(e.flags&r.FLAG_AUDIO_MESSAGE_LISTENED)}function p(e,t,a){var r=(0,i.getTab)(e,t);return!!(null==r?void 0:r.msgs)&&!!Object.keys(r.msgs).find((function(r){var n;return(null===(n=u(e,t,+r))||void 0===n?void 0:n.randomId)===a}))}function h(e,t,a){var n=(0,i.getTab)(e,t);if(n&&n.msgs){var o=a?u(e,t,a):void 0,l=Object.keys(e.msg_local_ids_sort||{}).length>1?Object.values(n.msgs).sort((function(t,a){var r=(0,s.parseMessage)(t).messageId,n=(0,s.parseMessage)(a).messageId;return v(e,r)-v(e,n)})):Object.values(n.msgs);if(!o)return(0,s.parseMessage)(l[l.length-1]);for(var c=o.local,d=l.length-1;d>=0;d--){var _=(0,s.parseMessage)(l[d]),g=_.local&&_.type!==r.EDIT_MESSAGE;if(!(!c&&g))if(c&&!g||v(e,o.messageId)>v(e,_.messageId))return _}}}function f(e,t){var a,r=null===(a=(0,i.getTab)(e,t))||void 0===a?void 0:a.lastmsg_meta;if(r)return Array.isArray(r)?(0,d.getMessageFromTuple)(r):r}function v(e,t){var a=(0,n.unpackStore)(e),r=a.msg_local_ids_sort&&a.msg_local_ids_sort[t];return void 0!==r?2e9+r:t}function b(e){return!!(e.flags&r.FLAG_OUTBOUND)}function C(e){return e.kludges&&void 0!==e.kludges.source_act}function E(e,t,a){var r=(0,i.getTab)(e,t);if(!r||!r.msgs)return null;var n=Object.keys(r.msgs).sort((function(e,t){return+e-+t}));if(!n)return null;var s=n&&n.indexOf(""+a);return-1===s?null:u(e,t,n[s-1])}function y(e,t){return b(t)?e.viewer_id:t.userId}function T(e,t){var a=(0,n.unpackStore)(e);return a.gid&&b(t)?Number(t.kludges.from_admin)||-a.gid:0}function I(e,t,a){var r=e.attaches[0];return!!r&&(r.type===t||void 0!==a&&r.type===a)}function A(e){return I(e,"doc")&&"graffiti"===e.attaches[0].kind}function L(e){return Boolean(e.attaches.find((function(e){return"doc"===e.type&&("audiomsg"===e.kind||"audio_message"===e.kind)})))}function S(e){return Boolean(e.attaches.find((function(e){return"sticker"===e.type})))}function k(e){return I(e,"gift")}function M(e){return I(e,"money_transfer","money_request")}function N(e){return I(e,"money_request")}function w(e){return I(e,"link","vkpay")&&!!e.kludges.attach1_app_id&&6217559==e.kludges.attach1_app_id}function P(e){return Boolean(e.kludges.is_expired||e.kludges.expire_ttl||e.kludges.ttl&&e.flags&r.FLAG_DELETE_BY_TTL)}function O(e){return e.kludges&&"call"===e.kludges.attach1_type}function R(e){return e&&e.attaches&&e.attaches[0]&&"group_call_in_progress"===e.attaches[0].type}function D(e,t){return"number"!=typeof t.messageId||((0,c.partConfigEnabled)("me_web_read_by_cmid")?b(t)?t.chat_local_id>(e.out_up_to_cmid||0):t.chat_local_id>(e.in_up_to_cmid||0):b(t)?t.messageId>(e.out_up_to||0):t.messageId>(e.in_up_to||0))}function F(e){return e.update_time>0}function x(e){var t=e.attaches.filter((function(e){return"mail"===e.type})).length>0;return!!(e.attaches.filter((function(e){return"reply"===e.type})).length>0||e.flags&r.FLAG_HAS_REPLY&&t)}function H(e){return e.attaches.some((function(e){return"mail"===e.type&&e.object.fwd_count>0}))&&!(e.flags&r.FLAG_HAS_REPLY)}function U(e){return Boolean(e.flags&r.FLAG_IMPORTANT)}function B(e,t){var a=(0,s.parseMessage)(t),r=(0,n.unpackStore)(e),o=(0,i.getTab)(r,a.peerId),l=r.viewer_id==a.peerId&&!r.gid,c=r.pinMessageEditSettings,d=c.messageEditAllowedTime,u=c.pinEditDelayTime,_=c.isPinEditEnabled,g=Date.now()/1e3,m=o&&(0,i.getPinnedMessage)(o),p=m&&m.messageId===a.messageId,h=a.kludges&&a.kludges.pinned_at,f=g-a.date>d,v=h&&g-h<u;if((0,i.isVKAgentPeer)(a.peerId))return!1;if(!l&&!b(a))return!1;if(C(a))return!1;if(p&&f&&_){if(v)return!1}else if(f)return!1;return!(k(a)||S(a)||L(a)||A(a)||M(a)||w(a)||O(a)||P(a)||function(e){return I(e,"widget")}(a))&&!function(e,t,a){var r=(0,n.unpackStore)(e),s=(0,i.getTab)(r,t);if(s){return(s.deleted||[]).includes(a)}return!1}(e,a.peerId,a.messageId)}function G(e,t){return 1e3*t+1e3*e.timeshift}function j(e,t,a,r,n){if(void 0===n&&(n=!1),y(r,t)!==y(r,a))return!0;var i=G(r,t.date),s=G(r,a.date);if(!(0,l.isSameDate)(i,s))return!0;if((0,o.isCommunityInterface)(r)&&Number(t.kludges.from_admin)!==Number(a.kludges.from_admin))return!0;if(a.date-t.date>300)return!0;if(C(t)||C(a))return!0;var c=P(t),d=P(a);if(c!==d)return!0;var u=t.kludges.is_expired,_=a.kludges.is_expired;if(c&&d&&u!==_)return!0;if(c&&d&&!u&&!_)return!0;if(c&&d&&u&&_)return!1;if(O(a)||O(t))return!0;if(R(a)||R(t))return!0;if(k(t)||k(a))return!0;if(A(t)||A(a))return!0;if(x(a))return!0;var g=!r.gid&&e.peerId===r.viewer_id;return!(D(e,t)===D(e,a)||!n||b(a)||g)}function q(e,t){return!(!e.blocked_community||!b(t))}function V(e){return e.messageId<=0}function z(e){var t=e.kludges.ttl||e.kludges.expire_ttl;return t?Number(t):void 0}function Y(e){return!(!e.kludges||!e.kludges.is_expired)}},606542:(e,t,a)=>{"use strict";a.d(t,{oCacheExists:()=>n,oCacheGet:()=>i});var r=a(982452);function n(e,t){return t in(0,r.unpackStore)(e).oCache}function i(e,t){var a=(0,r.unpackStore)(e).oCache[t];return a&&!a._n&&(!function(e){if(!e.first_name){var t=e.name.split(" ",2);e.first_name=t[0],e.short_name=t[1]?t[0]+" "+t[1].substr(0,1)+".":t[0]}e.inv_name||(e.inv_name=e.name),e.kick_name||(e.kick_name=e.inv_name)}(a),a._n=1),a}},993421:(e,t,a)=>{"use strict";a.d(t,{isLastMsgDebugEnabled:()=>i,getGroupId:()=>s,isCommunityInterface:()=>o,isReversedConvoOrder:()=>l,getPeer:()=>c,getUnreadCount:()=>d,getHeaderUnreadCount:()=>u,getUnreadCountNotMuted:()=>_,getUnreadCountWithMuted:()=>g,getHeaderTotalUnread:()=>m,getHeaderNotMutedUnread:()=>p,getLocalSettingsValue:()=>h,getPressedButtonState:()=>f,getKeyboardAppHash:()=>v,getActionCallbackTimeout:()=>b,isRecommendationListRerenderNeeded:()=>C,getEmojiOptId:()=>E,isClassicInterface:()=>y,isSearchView:()=>T,isTopCounterMuted:()=>I,isBusinessNotifyEnabled:()=>A});var r=a(982452),n=a(179288);function i(e){return(0,r.unpackStore)(e).isLastMsgFalseDebugger}function s(e){return(0,r.unpackStore)(e).gid}function o(e){return!!s(e)}function l(e){var t=(0,r.unpackStore)(e);return!!o(e)&&((19542789===t.gid||103416369===t.gid)&&(t.active_tab===n.ConvoListFolder.UNRESPOND||t.active_tab===n.ConvoListFolder.UNREAD))}function c(e){return(0,r.unpackStore)(e).peer}function d(e){var t=(0,r.unpackStore)(e);return t.settings.show_only_not_muted_messages?t.unread_counters.countNotMuted:t.unread_counters.count}function u(e){var t=(0,r.unpackStore)(e);return t.settings.show_only_not_muted_messages?t.unread_counters.headerNotMutedUnread:t.unread_counters.headerTotalUnread}function _(e){return(0,r.unpackStore)(e).unread_counters.countNotMuted}function g(e){return(0,r.unpackStore)(e).unread_counters.count}function m(e){return(0,r.unpackStore)(e).unread_counters.headerTotalUnread}function p(e){return(0,r.unpackStore)(e).unread_counters.headerNotMutedUnread}function h(e,t){return(0,r.unpackStore)(e).settings[t]}function f(e,t){var a=(0,r.unpackStore)(t),n=c(t),i=a.callbackEventButtons.get(n);return i?i.get(e):void 0}function v(e){return(0,r.unpackStore)(e).keyboard_app_hash}function b(e){return(0,r.unpackStore)(e).callbackActionTimeout}function C(e){return(0,r.unpackStore)(e).isRecommendationListRerenderNeeded}function E(e){return(0,r.unpackStore)(e).emojiOptId}function y(e){var t=(0,r.unpackStore)(e);return Boolean(t.gid||t.isClassic)}function T(e){var t=(0,r.unpackStore)(e);return Boolean(t.searchText||t.recentSearch)}function I(e){var t=(0,r.unpackStore)(e);return!o(e)&&!t.invitation}function A(e){return!!(0,r.unpackStore)(e).isBusinessNotifyEnabled}},179203:(e,t,a)=>{"use strict";a.d(t,{addNewMember:()=>l,createChatAction:()=>c,createCommunityChatAction:()=>d,cancelMessageRequestAction:()=>_,kickUserAction:()=>g});var r=a(570655),n=a(653736),i=a(826542),s=a(407381),o=a(827749),l=(0,n.wrapHashAction)((function(e,t,a,r){var n;return(0,i.addChatMembers)(e,t,r.gid,(null===(n=r.tabs[e])||void 0===n?void 0:n.hash)||"",a).then((function(){return r}))})),c=(0,n.wrapHashActionReversed)((function(e,t,a,n,o){var l;return e.creating=!0,null===(l=e.longpoll)||void 0===l||l.pause(),(0,i.multiStart)(e.writeHash,a,n,o).then((function(t){var a,n=(0,r.__read)(t,1)[0];return e.next_peer=n.peerId,e.tabs[n.peerId]=n,(0,s.updateListedConvos)(e,n,!1,(function(e){return[n.peerId].concat(e)})),null===(a=e.longpoll)||void 0===a||a.resume(),e})).then((function(e){return t?u(e,e.next_peer,t):e})).then((function(e){return e.creating=!1,e})).catch((function(t){var a;throw e.creating=!1,null===(a=e.longpoll)||void 0===a||a.resume(),t}))})),d=(0,n.wrapHashActionReversed)((function(e,t,a,n,s){return void 0===s&&(s=!1),e.creating=!0,(0,i.multiStart)(e.writeHash,[],a,void 0,e.gid,!0,s).then((function(a){var i=(0,r.__read)(a,1)[0].peer_id;if(!i)throw new Error("No peer_id");return e.peer=i,(0,o.collectChatCreateStats)(i,n,e.gid),t?u(e,i,t):e})).then((function(e){return e.creating=!1,e})).catch((function(t){throw e.creating=!1,t}))}));function u(e,t,a){return(0,i.ownerPhotoSave)(t,a,e.gid).then((function(){return e}))}var _=(0,n.wrapHashActionReversed)((function(e,t,a){return(0,i.kickUser)(t,a,e.tabs[t].hash||"").then((function(){var r=e.tabs[t];return r&&r.invitedByMessageRequest&&(r.invitedByMessageRequest=r.invitedByMessageRequest.filter((function(e){return e.id!==a}))),e}))})),g=(0,n.wrapHashActionReversed)((function(e,t,a){var r=e.tabs[t];return(0,i.kickUser)(t,a,r.hash||"",e.gid).then((function(){return r.memberIds=r.memberIds.filter((function(e){return e!==a})),r.adminIds=r.adminIds.filter((function(e){return e!==a})),r.membersCount=r.memberIds.length,e}))}))},917791:(e,t,a)=>{"use strict";a.d(t,{loadConversations:()=>y,loadPeer:()=>T,restoreHistoryQueue:()=>I,restoreQueuedMessagesInDom:()=>A,searchHints:()=>L,pinConvoHandler:()=>S,unpinConvoHandler:()=>k,getCustomChatMemberSearch:()=>M,toggleHideFolderHandler:()=>N,toggleHideFolderNoticeHandler:()=>w});var r=a(570655),n=a(653736),i=a(826542),s=a(475234),o=a(653004),l=a(407381),c=a(460615),d=a(240367),u=a(191040),_=a(18149),g=a(993421),m=a(459554),p=a(19331),h=a(923876),f=a(712860),v=a(376473),b=a(419672),C=a(968958),E=a(754204),y=(0,n.wrapHashActionReversed)((function(e,t,a,n){return(0,i.getConversations)(e.writeHash,e.gid,t,a,n).then((function(e){return(0,r.__read)(e,1)[0]}))})),T=function(e,t,a,n,l,c){e.tabHistoryNotChanged=!1;var d=(0,m.getTab)(e,t),_=d&&(d.lastmsg||Object.keys(d.msgs||{}).length>0),g=n&&(0,p.partConfigEnabled)("messages_new_empty_dialog_screen")&&!(0,h.getEmptyScreenUserInfo)(e,t)&&!_&&(0,m.isUserEmptyScreenRich)(e,t)?(0,f.loadUserEmptyDialogData)(t).catch((function(){return Promise.resolve()})):Promise.resolve(),v=(0,u.retryFn)(i.start,3,(function(e){return e-1}))(t,a||0,!!n,e.prevPeer,e.gid,l);return Promise.all([v,g]).then((function(n){var i=(0,r.__read)(n,2),l=i[0],c=i[1],d=(0,r.__read)(l,6),u=d[0],_=d[1],g=d[2],m=d[3],p=d[4],f=d[5];if(c&&!u.history&&(0,s.addEmptyScreenUserInfo)(t,c,e),_.forEach((function(t){return(0,o.oCacheAdd)(e,t)})),e.tabs||(e.tabs={}),e.dialog_tab_cts=p,e.tabs[t]||(e.tabs[t]=(0,h.normalizeTab)(e,u)),(0,s.updateBlockStates)(m,e).then((function(){})).catch((function(){})),a){if(e.tabs[t]){var v=e.tabs[t].lastmsg,b=e.tabs[t].lastmsg_meta;e.tabs[t]=(0,r.__assign)((0,r.__assign)({},e.tabs[t]),u),e.tabs[t].lastmsg=v,e.tabs[t].lastmsg_meta=b}}else e.tabs[t]=(0,r.__assign)((0,r.__assign)({},e.tabs[t]),u);return e.admins=(0,r.__assign)((0,r.__assign)({},e.admins),g),f&&(e.tabs[t].peer_profile_info=f),I(e,t)})).catch((function(e){var t=(0,E.getErrorText)(e,"loadPeer ["+c+"]");return(0,C.imWeirdCatch)("loadPeer",t)}))};function I(e,t){if(!e.imQueue||!e.imQueueSet)return Promise.resolve(e);var a=e.imQueue(t,!1),r=(0,m.getTab)(e,t);if(!r)return Promise.resolve(e);var n=a.filter((function(a){return!(0,v.isExistingRid)(e,t,a.rid)}));return r.msgs=n.reduce((function(e,t){return e["rid"+t.rid]=t.mess,e}),r.msgs||{}),e.imQueueSet(t,n).then((function(){})).catch((function(){})),r.history=A(e,n,r.history),Promise.resolve(e)}function A(e,t,a){if(!e.imQueue)return a;var r=Array.isArray(t)?t:e.imQueue(t,!1);return 0===r.length||r.map((function(e){return e.mess.failed=!!e.failed,e.mess})).filter((function(t){return(0,v.isMessageStored)(e,t.peerId,t.messageId)})).forEach((function(t){return(0,b.appendMessageToHistory)(e,t,a)})),a}function L(e,t,a,n,d){return void 0===a&&(a=i.HintsSearchType.ALL),(0,i.hints)(e,n.hidegid?0:d.gid,a,t).then((function(e){var t=(0,r.__read)(e,3),a=t[0],i=t[1],c=t[2];return n.skipStoreUpdate||(i.forEach((function(e){return(0,o.oCacheAdd)(d,e)})),(0,s.updateBlockStates)(c,d).then((function(){}),(function(){})),(0,l.mergeTabs)(d,a).then((function(){}),(function(){}))),a})).then((function(t){if(e){var a=t&&Object.keys(t).length;(0,c.saveSearchAttemptStats)(c.serviceMessages,0,a,e)}return Object.keys(t).sort((function(e,a){return t[+e].order-t[+a].order})).map((function(e){return t[+e]}))}))}var S=(0,n.wrapHashActionReversed)((function(e,t){var a;return(0,i.pinConvo)(t,(null===(a=e.tabs[t])||void 0===a?void 0:a.hash)||"")})),k=(0,n.wrapHashActionReversed)((function(e,t){var a;return(0,i.unpinConvo)(t,(null===(a=e.tabs[t])||void 0===a?void 0:a.hash)||"")})),M=(0,n.wrapHashActionReversed)((function(e,t){var a=(0,m.getTab)(e,t);if(!a||!(0,m.isChatConvo)(a))return Promise.resolve(e);if(a.isDonutChat){function t(e){return e.map((function(e){return{name:e.first_name+" "+e.last_name,id:e.id,photo:e.photo_100,peerId:e.id}}))}var n=a.ownerId,i=(0,g.isCommunityInterface)(e),s="photo_100";return a.customChatMemberServerSearch=(0,u.debouncedPromise)((function(e){var a={q:e,from_list:"donut",group_id:-n,fields:s};return i&&(a=(0,r.__assign)((0,r.__assign)({},a),{from_list:"donut_friends"})),(0,d.search)(a).then((function(e){var a=e.items;return Array.isArray(a)?t(a):[]}))}),400),(i?(0,d.getMembers)({group_id:String(-n),filter:"donut",fields:s}):(0,d.getFriends)({owner_id:n,fields:s})).then((function(r){var n=t(r.items),i=new _.vkIndexer(n,(function(e){return e.name}));return a.customChatMemberSearch=function(e){return Promise.resolve(e?i.search(e):i.list)},e}))}return Promise.resolve(e)})),N=(0,n.wrapHashActionReversed)((function(e,t,a,r){return void 0===r&&(r=!1),(0,i.toggleHideFolder)(t,a,r,e.writeHash)})),w=(0,n.wrapHashActionReversed)((function(e,t,a){return(0,i.toggleHideFolderNotice)(t,a,e.writeHash)}))},407381:(e,t,a)=>{"use strict";a.d(t,{mergeTabs:()=>m,updateListedConvos:()=>p,removeDeletedUnreadMsgsFromTab:()=>h,setFilteredExpiringMessagesData:()=>f,setFilteredMentionsData:()=>v,setActions:()=>b,updateRecommendedListItemOnline:()=>E,removeStoredRecommendedListItem:()=>y,setConvoIsNew:()=>T,setConvoBusinessNotifyEnabled:()=>I,resetFolderList:()=>A});var r=a(570655),n=a(923876),i=a(412827),s=a(993421),o=a(459554),l=a(294378),c=a(179288),d=a(982452),u=a(826338),_=a(19331),g=a(145072);function m(e,t,a){(0,n.normalizeTabsGotFromServer)(e,t);var o=e.tabs[e.peer];return e.tabs=Object.keys(t).reduce((function(a,n){var o=Number(n),c=e.tabs[o]?e.tabs[o].msgs:{},d=Object.assign({},c||{},t[o].msgs||{});(0,_.partConfigEnabled)("im_clocks_fix")&&Object.keys(t[o].msgs||{}).filter((function(e){return c&&!c[e]})).forEach((function(t){var a=(0,i.parseMessage)(d[t]);a.randomId&&e.imQueueComplete&&(e.imQueueComplete(o,a.randomId),delete d["rid"+a.randomId],(0,_.partConfigEnabled)("im_chasiky_debug")&&window.meBufferLog&&delete window.meBufferLog[a.randomId])}));return a[o]=Object.assign({},e.tabs[o]||{},t[o]),d&&(a[o].msgs=d),t[o].lastmsg||((0,s.isLastMsgDebugEnabled)(e)&&!1!==a[o].lastmsg&&(console.log((0,r.__assign)({},t[o])),(0,l.showDebugAlert)()),a[o].lastmsg=!1),a}),e.tabs),o&&!a&&(e.tabs[e.peer]=o),Promise.resolve(e)}function p(e,t,a,r,i){t.deletedDialog||(e.dialog_tabs=Object.keys(e.dialog_tabs).reduce((function(e,s){var o=e[s];return!a&&!(0,n.getFilterFnForConvoListFolder)(s)(t)||i&&!i(s,o,t)||(e[s]=(0,d.arrayUnique)(r(o,s))),e}),e.dialog_tabs))}function h(e,t,a){var r=(0,o.getTab)(a,e);if(!r)return Promise.resolve(a);if(r.unread=r.unread?r.unread-t.length:0,(0,_.partConfigEnabled)("me_web_read_by_cmid")){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});f(e,(function(e){return!n[e]}),a),v(e,(function(e){return!n[e]}),a)}else{var i=t.reduce((function(e,t){return e[t]=!0,e}),{});f(e,(function(e){return!i[e]}),a),v(e,(function(e){return!i[e]}),a)}return Promise.resolve(a)}function f(e,t,a){var r=(0,o.getTab)(a,e);return r?((0,_.partConfigEnabled)("me_web_read_by_cmid")?r.expiring_cmids&&(r.expiring_cmids=r.expiring_cmids.filter(t),r.expiring_cmids.length||delete r.expiring_cmids):r.expiring_messages&&(r.expiring_messages=r.expiring_messages.filter(t),r.expiring_messages.length||delete r.expiring_messages),a):a}function v(e,t,a){var r=(0,o.getTab)(a,e);return r?((0,_.partConfigEnabled)("me_web_read_by_cmid")?r.mention_cmids&&(r.mention_cmids=r.mention_cmids.filter(t),r.mention_cmids.length||delete r.mention_cmids):r.mentions&&(r.mentions=r.mentions.filter(t),r.mentions.length||delete r.mentions),a):a}function b(e){var t=e.peer,a=e.id;if(0===t)return Promise.resolve(e);var r=(0,o.getTab)(e,t);if(!r)return Promise.resolve(e);var n=(0,u.isChatPeer)(t),i=(0,o.isChannelPeer)(r),l=(0,o.isCommunityChat)(r),d=(0,o.isBusinessNotifyTab)(r)&&(0,s.isBusinessNotifyEnabled)(e),m=(0,o.tabIsArchived)(r),p=n&&!(0,o.isChatActive)(r),h=!!r.offset,f=[];return d?(f.push(e.mutedPeers.includes(t)?c.ConvoAction.UNMUTE:c.ConvoAction.MUTE),f.push((0,o.isConvoBusinessNotifyEnabled)(r)?c.ConvoAction.DISABLE_BUSINESS_NOTIFY:c.ConvoAction.ENABLE_BUSINESS_NOTIFY),f.push(c.ConvoAction.CLEAR),Promise.resolve(C(e,r,f))):(h&&f.push(c.ConvoAction.MEDIA),(0,s.isCommunityInterface)(e)||!(0,u.isUserPeer)(t)||(0,u.isContactPeer)(t)||(0,u.isVkAdminPeer)(t)||(0,u.isSupportAgentPeer)(t)||a===t||r.blacklisted||r.block_error||r.is_subscribed||r.is_new||f.push(c.ConvoAction.ADD_FRIEND),h&&f.push(c.ConvoAction.SEARCH),0===r.unread&&f.push(c.ConvoAction.UNREAD),!(0,u.isEmailPeer)(t)&&!h||i||f.push(c.ConvoAction.CLEAR),!(0,s.isCommunityInterface)(e)||i||l||f.push(c.ConvoAction.BLOCK),i&&!p&&f.push(c.ConvoAction.SETTINGS),(0,u.isCommunityPeer)(t)&&(r.can_send_notify?f.push(c.ConvoAction.BLOCK_NOTIFY):f.push(r.blocked_community?c.ConvoAction.ALLOW_COMMUNITY:c.ConvoAction.BLOCK_COMMUNITY)),!((0,_.partConfigEnabled)("fav_dialog_with_yourself")&&a===t)&&!(0,s.isCommunityInterface)(e)&&!(0,u.isContactPeer)(t)&&(n||(0,u.isUserPeer)(t)||(0,u.isCommunityPeer)(t))&&(!n||!p)&&f.push(e.mutedPeers.includes(t)?c.ConvoAction.UNMUTE:c.ConvoAction.MUTE),!(0,s.isCommunityInterface)(e)&&(0,u.isUserPeer)(t)&&r.is_friend&&!r.block_error&&!e.isMRToChatEnabled&&f.push(c.ConvoAction.CREATE_CHAT),n&&!p&&(0,g.canInviteUser)(e,t)&&!(0,s.isCommunityInterface)(e)&&f.push(c.ConvoAction.CHAT_INVITE),!(0,s.isCommunityInterface)(e)&&(0,u.isUserPeer)(t)&&t!==window.vk.id&&!r.blacklisted&&!r.block_error&&r.canBeAddedToChat&&e.isMRToChatEnabled&&f.push(c.ConvoAction.USER_INVITE),!n||p||(0,s.isCommunityInterface)(e)||f.push(c.ConvoAction.LEAVE),n&&r.data.closed&&!r.data.kicked&&f.push(c.ConvoAction.RETURN),(0,o.canBePinned)(e,r)&&f.push((0,u.isPinnedSortId)(r.major_sort_id||0)?c.ConvoAction.UNPIN_CONVO:c.ConvoAction.PIN_CONVO),n&&r.pinned&&(f.push((0,o.isPinnedMessageHidden)(r)?c.ConvoAction.PIN_UNHIDE:c.ConvoAction.PIN_HIDE),(0,g.canPinOrUnpin)(e)&&!m&&f.push(c.ConvoAction.UNPIN)),(0,_.partConfigEnabled)("im_archive_web")&&(0,o.canArchiveTab)(r)&&!(0,s.isCommunityInterface)(e)&&f.push(m?c.ConvoAction.UNARCHIVE:c.ConvoAction.ARCHIVE),Promise.resolve(C(e,r,f)))}function C(e,t,a){var r=(0,n.getConvoActionData)(t,(0,s.isCommunityInterface)(e));return e.curActions=a.reduce((function(e,t){return e[t]=r[t],e}),{}),e}function E(e,t,a,r){var n=e.recommendationList,i=n&&n.item_data[t];return i&&(i.online=a||r?1:0,i.online_info&&(i.online_info.is_online=a,i.online_info.is_mobile=r)),Promise.resolve(e)}function y(e,t){var a=e.recommendationList;if(!a)return Promise.resolve(e);var n=(0,r.__assign)({},a.item_data);return delete n[t],e.recommendationList=(0,r.__assign)((0,r.__assign)({},a),{items:a.items.filter((function(e){return e!==t})),item_data:n}),Promise.resolve(e)}function T(e,t,a){return a.tabs[e]&&(a.tabs[e].is_new=!!t),Promise.resolve(a)}function I(e,t,a){var r=(0,o.getTab)(e,t);return r?(r.can_send_business_notify=a,Promise.resolve(e)):Promise.resolve(e)}function A(e,t){return e.dialog_tabs[t]=[],e.dialog_tabs_all[t]=!1,Promise.resolve(e)}},121074:(e,t,a)=>{"use strict";a.d(t,{loadHashes:()=>n});var r=a(826542);function n(e,t,a){return(0,r.renewHash)(e,t.hidegid?void 0:a.gid)}},588870:(e,t,a)=>{"use strict";a.d(t,{getFullMessage:()=>l,markAudioMessageAsListened:()=>c});var r=a(189798),n=a(240367),i=a(376473),s=a(294940),o=a(712439),l=function(e,t){return(0,r.api)("messages.getByConversationMessageId",{peer_id:e,conversation_message_ids:t,extended:1,fields:"kludges"})},c=function(e,t,a){var r=(0,o.unpackStore)(e),l=(0,i.getMessage)(r,a,t);return!l||(0,s.isOut)(l)||(0,i.isVoiceMessageListened)(l)?Promise.reject():(0,n.markAsListened)(t,r.gid)}},712860:(e,t,a)=>{"use strict";a.d(t,{updateConvoRecommendationList:()=>o,loadUserEmptyDialogData:()=>l,setPeerSubscribedStatus:()=>c});var r=a(570655),n=a(240367),i=a(826542),s=(0,a(191040).debouncedPromise)(i.getRecommendedContacts,3e3);function o(e){return e.isRecommendationListRerenderNeeded=!1,e.isRecommendationListEnabled?s().then((function(t){var a=(0,r.__read)(t,1)[0];if(!a)return e;var n=!e.recommendationList||e.recommendationList.items.some((function(e,t){return e!==a.items[t]}));return e.recommendationList=a,e.isRecommendationListRerenderNeeded=n,e})).catch((function(t){if("debounce"===t)return e;throw t})):Promise.resolve(e)}function l(e){return(0,n.getMutual)({target_uid:e,order:"random",count:3}).then((function(t){return(0,n.usersGet)({user_ids:(0,r.__spreadArray)([e],(0,r.__read)(t)).join(","),fields:"occupation, bdate, city, can_write_private_message, common_count, photo"})}))}function c(e,t,a){var r=a.tabs[e];return r?(t?(0,n.deleteFriend)({user_id:e}):(0,n.addFriend)({user_id:e})).then((function(){return r.is_subscribed=!t,r.is_subscribed&&r.is_subscribed_to_me&&(r.is_friend=1),Promise.resolve(a)})):Promise.resolve(a)}},475234:(e,t,a)=>{"use strict";a.d(t,{updateBlockStates:()=>s,setChatList:()=>o,setUnreadCounters:()=>l,addToUnreadCounter:()=>c,setLocalSettingsValue:()=>d,setPressedCallbackButton:()=>u,unsetPressedCallbackButton:()=>_,setActionCallbackTimeout:()=>g,unsetActionCallbackTimeout:()=>m,addEmptyScreenUserInfo:()=>p});var r=a(570655),n=a(179288),i=a(993421);function s(e,t){return t.block_states=(0,r.__assign)((0,r.__assign)({},t.block_states),e),Promise.resolve(t)}function o(e,t){return e.chatList=t,Promise.resolve(e)}function l(e,t){var a,r,s,o,l,c,d=e.count,u=e.countNotMuted,_=e.headerNotMutedUnread,g=e.headerTotalUnread,m=e.businessNotifyUnread,p=void 0===m?0:m,h=e.archiveUnreadCount,f=e.archiveUnreadUnmutedCount,v=e.archiveMentionsCount;return t.unread_counters={headerNotMutedUnread:_,headerTotalUnread:g,count:d,countNotMuted:u},t.dialog_tab_cts[n.ConvoListFolder.UNREAD]={total:(0,i.getUnreadCount)(t),unread:d,unreadNotMuted:u},t.dialog_tab_cts[n.ConvoListFolder.BUSINESS_NOTIFY]={total:Math.max(null!==(s=null===(r=null===(a=t.dialog_tab_cts)||void 0===a?void 0:a[n.ConvoListFolder.BUSINESS_NOTIFY])||void 0===r?void 0:r.total)&&void 0!==s?s:0,p),unread:p},t.dialog_tab_cts[n.ConvoListFolder.ARCHIVE]={total:Math.max(null!==(c=null===(l=null===(o=t.dialog_tab_cts)||void 0===o?void 0:o[n.ConvoListFolder.ARCHIVE])||void 0===l?void 0:l.total)&&void 0!==c?c:0,h),unread:h,unreadNotMuted:f,mentions:v},Promise.resolve(t)}function c(e,t,a){var r=Math.max(0,(0,i.getUnreadCountNotMuted)(a)+e),n=Math.max(0,(0,i.getUnreadCountWithMuted)(a)+e),s=Math.max(0,(0,i.getHeaderNotMutedUnread)(a)+e),o=Math.max(0,(0,i.getHeaderTotalUnread)(a)+e);return a.mutedPeers.includes(t)||(a.unread_counters.countNotMuted=r,a.unread_counters.headerNotMutedUnread=s),a.unread_counters.count=n,a.unread_counters.headerTotalUnread=o,Promise.resolve(a)}function d(e,t,a){return a.settings[e]=t,Promise.resolve(a)}function u(e,t,a){var r=e.peerId,n=e.eventId;a.callbackEventButtons.has(r)||a.callbackEventButtons.set(r,new Map);var i=a.callbackEventButtons.get(r);return i&&i.set(n,t),Promise.resolve(a)}function _(e,t){var a=e.peerId,r=e.eventId,n=t.callbackEventButtons?t.callbackEventButtons.get(a):void 0;if(!n)return Promise.resolve(t);var i=n.get(r);return i&&clearTimeout(i.timeout),n.delete(r),n.size||t.callbackEventButtons.delete(a),Promise.resolve(t)}function g(e,t){return t.callbackActionTimeout=e,Promise.resolve(t)}function m(e){return clearTimeout(e.callbackActionTimeout),e.callbackActionTimeout=void 0,Promise.resolve(e)}function p(e,t,a){var n,i,s;a.emptyScreenUserInfo||(a.emptyScreenUserInfo={});var o=(0,r.__read)(t),l=o[0],c=o.slice(1);if(l){var d=c.map((function(e){return{name:e.first_name||"",photo:e.photo}}));a.emptyScreenUserInfo[e]={bdate:l.bdate,occupation:null===(n=l.occupation)||void 0===n?void 0:n.name,occupationType:null===(i=l.occupation)||void 0===i?void 0:i.type,city:null===(s=l.city)||void 0===s?void 0:s.title,commonCount:l.common_count,canWrite:l.can_write_private_message,mutualFriends:d}}}},653004:(e,t,a)=>{"use strict";a.d(t,{oCacheAdd:()=>n});var r=a(982452);function n(e,t){var a=(0,r.unpackStore)(e);a.oCache||(a.oCache={}),t.id&&(a.oCache[t.id]=t)}},923876:(e,t,a)=>{"use strict";a.d(t,{mergeConvoLists:()=>I,normalizeTabsGotFromServer:()=>A,normalizeTab:()=>L,getContactPeerId:()=>S,getConvoInfoFromLocalIndex:()=>k,getFilterFnForConvoListFolder:()=>M,getDataForChatMemberGrid:()=>N,sortFn:()=>w,getConvoActionData:()=>P,getConvoInlineMenuActionData:()=>O,isDialogWithYourself:()=>R,getEmptyScreenUserInfo:()=>D});var r=a(570655),n=a(826338),i=a(712439),s=a(459554),o=a(993421),l=a(294378),c=a(606542),d=a(179288),u=a(19331),_=a(786067),g=a(527864),m=a(743620),p=a(537741),h=a(491372),f=a(467233),v=a(129175),b=a(336322),C=a(774701),E=a(784502),y=a(700521),T=a(549386);function I(e,t,a){var n=e.reduce((function(e,t){return e.set(t.peerId,!0),e}),new Map),i=a||function(){return!0};return(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(e)),(0,r.__read)(t.filter((function(e){return!n.has(e.peerId)&&i(e)}))))}function A(e,t){for(var a in t)t.hasOwnProperty(a)&&L(e,t[a])}function L(e,t){var a,i=(0,c.oCacheGet)(e,t.peerId),d=(0,s.getTab)(e,t.peerId),u=t.lastmsg;if(i&&(t.photo=t.photo||i.photo,t.name=t.name||i.name,t.href=t.href||i.link,t.sex=t.sex||i.sex),t.last_touched=(null==d?void 0:d.last_touched)||0,t.verified=!!t.verified,t.lastmsg=u||t.lastmsg_meta&&t.lastmsg_meta[0]||!1,(0,o.isLastMsgDebugEnabled)(e)&&(u||t.lastmsg_meta&&t.lastmsg_meta[0])&&!1===t.lastmsg&&(console.log((0,r.__assign)({},t)),(0,l.showDebugAlert)()),t.folders=t.folders||null,t.unread=t.unread||0,t.online=t.online||0,t.is_new=!!t.is_new,t.out_up_to=null!=t.out_up_to?t.out_up_to:t.in_up_to||0,t.out_up_to_cmid=null!=t.out_up_to_cmid?t.out_up_to_cmid:t.in_up_to_cmid||0,(0,n.isUserPeer)(t.peerId)){var _=t.last_seen;t.online=_&&(null==_?void 0:_.platform)||0,t.last_seen=t.last_seen||{platform:0,time:0,mobile:0,can_see:0}}return(0,n.isChatPeer)(t.peerId)&&(t.memberIds=t.memberIds||(null===(a=d)||void 0===a?void 0:a.memberIds)||null),t}function S(e){return e+19e8}function k(e){var t={peerId:e[0],name:e[1],tab:e[1],photo:e[2],href:e[3],online:e[4],is_friend:e[5],local_index:!0};return e[6]&&(t.data={flags:e[6]}),t}function M(e){switch(e){case d.ConvoListFolder.ALL:return function(e){return!(((0,u.partConfigEnabled)("simplified_start_conversation")?(0,s.tabIsNotImportantMessageRequest)(e):(0,s.tabIsMessageRequest)(e))||(0,s.tabIsBusinessNotification)(e)||(0,s.tabIsArchived)(e))};case d.ConvoListFolder.UNREAD:return function(e){return!(0,s.tabIsMessageRequest)(e)&&!(0,s.tabIsBusinessNotification)(e)&&!(0,s.tabIsArchived)(e)&&(e.unread&&e.unread>0||(0,s.isTabMarkedUnread)(e))};case d.ConvoListFolder.MR:return function(e){return(0,u.partConfigEnabled)("simplified_start_conversation")?(0,s.tabIsNotImportantMessageRequest)(e):(0,s.tabIsMessageRequest)(e)};case d.ConvoListFolder.BUSINESS_NOTIFY:return s.tabIsBusinessNotification;case d.ConvoListFolder.ARCHIVE:return s.tabIsArchived;default:return function(t){return t.folders&&t.folders&d.FOLDER_MASKS[e]}}}function N(e,t,a){var r=t.data.active.slice(0,4).map((function(t){return(0,c.oCacheGet)(e,t)})).filter((function(e){return!!e}));return[r.map((function(e){return e.photo})),a?r.map((function(e){return e.link})):[]]}function w(e,t,a){var r=(t.lastmsg||!(0,u.partConfigEnabled)("messenger_empty_pinned_support"))&&t.major_sort_id||0,n=(a.lastmsg||!(0,u.partConfigEnabled)("messenger_empty_pinned_support"))&&a.major_sort_id||0,i=r!==n?n-r:(0,s.getLocalSortId)(e,a)-(0,s.getLocalSortId)(e,t);return(0,o.isReversedConvoOrder)(e)?-i:i}function P(e,t){var a,r=(0,s.isChannelPeer)(e);return(a={})[d.ConvoAction.SEARCH]={icon:"search",name:(0,_.getLang)("mail_im_peer_search")},a[d.ConvoAction.BLOCK_COMMUNITY]={icon:"block",name:(0,_.getLang)("mail_block_comm_messages")},a[d.ConvoAction.BLOCK_NOTIFY]={icon:"block",name:(0,_.getLang)("mail_block_notify_messages")},a[d.ConvoAction.ALLOW_COMMUNITY]={icon:"unblock",name:(0,_.getLang)("mail_allow_comm_messages")},a[d.ConvoAction.CLEAR]={icon:"clear",name:(0,n.isEmailPeer)(e.peerId)?(0,_.getLang)("mail_im_delete_email_contact"):(0,_.getLang)("mail_im_delete_all_history")},a[d.ConvoAction.MUTE]={icon:"mute",name:(0,_.getLang)("mail_im_mute")},a[d.ConvoAction.PIN_CONVO]={icon:"pin_convo",name:(0,_.getLang)("mail_pin_chat")},a[d.ConvoAction.UNPIN_CONVO]={icon:"unpin_convo",name:(0,_.getLang)("mail_unpin_chat")},a[d.ConvoAction.UNMUTE]={icon:"unmute",name:(0,_.getLang)("mail_im_unmute")},a[d.ConvoAction.MEDIA]={icon:"media",name:t?(0,_.getLang)("mail_im_show_media_history_group"):(0,_.getLang)("mail_im_show_media_history")},a[d.ConvoAction.BLOCK]={icon:"block",name:(0,_.getLang)("mail_block_user")},a[d.ConvoAction.CHAT_INVITE]={icon:"add",name:(0,_.getLang)("mail_im_create_chat_with")},a[d.ConvoAction.USER_INVITE]={icon:"invite",name:(0,n.isUserPeer)(e.peerId)&&1===e.canBeAddedToChat?(0,_.getLang)("mail_im_add_to_chat"):(0,_.getLang)("mail_im_invite_to_chat")},a[d.ConvoAction.ADD_FRIEND]={icon:"add_friend",name:e.is_subscribed_to_me?(0,_.getLang)("mail_im_add_to_friends_accept"):(0,_.getLang)("mail_im_add_to_friends")},a[d.ConvoAction.CREATE_CHAT]={icon:"invite",name:(0,_.getLang)("mail_im_create_chat_with")},a[d.ConvoAction.LEAVE]={icon:"leave",name:(0,s.isBusinessNotifyTab)(e)?(0,_.getLang)("mail_delete"):r?(0,_.getLang)("mail_leave_channel"):(0,_.getLang)("mail_leave_chat")},a[d.ConvoAction.RETURN]={icon:"return",name:r?(0,_.getLang)("mail_return_to_vkcomgroup"):(0,_.getLang)("mail_return_to_chat")},a[d.ConvoAction.PIN_HIDE]={icon:"pin_hide",name:(0,_.getLang)("mail_menu_pin_hide")},a[d.ConvoAction.PIN_UNHIDE]={icon:"pin_unhide",name:(0,_.getLang)("mail_menu_pin_show")},a[d.ConvoAction.UNPIN]={icon:"unpin",name:(0,_.getLang)("mail_menu_unpin")},a[d.ConvoAction.SETTINGS]={icon:"settings",name:r?(0,_.getLang)("mail_vkcomgroup_settings"):(0,_.getLang)("mail_settings")},a[d.ConvoAction.CALL_AUDIO]={icon:"call_audio",name:(0,_.getLang)("mail_im_call_audio")},a[d.ConvoAction.CALL_VIDEO]={icon:"call_video",name:(0,_.getLang)("mail_im_call_video")},a[d.ConvoAction.CALL_APP]={icon:"call_app",name:(0,_.getLang)("mail_im_call_app")},a[d.ConvoAction.UNREAD]={icon:"unread",name:(0,_.getLang)("mail_menu_mark_unread")},a[d.ConvoAction.CALL_BY_NAME]={icon:"call_by_name",name:(0,_.getLang)("mail_im_call_by_name")},a[d.ConvoAction.ENABLE_BUSINESS_NOTIFY]={icon:"notify",name:(0,_.getLang)("mail_im_enable_business_notify")},a[d.ConvoAction.DISABLE_BUSINESS_NOTIFY]={icon:"disable",name:(0,_.getLang)("mail_im_disable_business_notify")},a[d.ConvoAction.ARCHIVE]={icon:"archive",name:(0,_.getLang)("mail_im_archive")},a[d.ConvoAction.UNARCHIVE]={icon:"unarchive",name:(0,_.getLang)("mail_im_unarchive")},a[d.ConvoAction.BUSINESS_NOTIFY]={icon:"business_notify",name:(0,_.getLang)("mail_im_business_notify")},a}function O(e,t){var a=P(e,t);return[[d.ConvoAction.ARCHIVE,(0,g.getIcon20ArchiveOutline)().icon],[d.ConvoAction.UNARCHIVE,(0,m.getIcon20UnarchiveOutline)().icon],[d.ConvoAction.UNREAD,(0,p.getIcon20MessageUnreadTopOutline)().icon],[d.ConvoAction.PIN_CONVO,(0,h.getIcon20PinOutline)().icon],[d.ConvoAction.UNPIN_CONVO,(0,f.getIcon20PinSlashOutline)().icon],[d.ConvoAction.MUTE,(0,v.getIcon20MuteOutline)().icon],[d.ConvoAction.UNMUTE,(0,b.getIcon20VolumeOutline)().icon],[d.ConvoAction.LEAVE,(0,E.getIcon20Cancel)().icon],[d.ConvoAction.CLEAR,(0,C.getIcon20DeleteOutline)().icon],[d.ConvoAction.ENABLE_BUSINESS_NOTIFY,(0,y.getIcon20NotificationOutline)().icon],[d.ConvoAction.DISABLE_BUSINESS_NOTIFY,(0,T.getIcon20BlockOutline)().icon]].reduce((function(e,t){var n=(0,r.__read)(t,2),i=n[0],s=n[1];return e[i]=(0,r.__assign)((0,r.__assign)({},a[i]),{icon:s}),e}),{})}function R(e,t){return(0,u.partConfigEnabled)("fav_dialog_with_yourself")&&e===t}function D(e,t){var a=(0,i.unpackStore)(e);return a.emptyScreenUserInfo&&a.emptyScreenUserInfo[t]}},294378:(e,t,a)=>{"use strict";function r(e){void 0===e&&(e=!1),console.trace(),e||window.alert("Вы поймали баг исчезнувшего lastMsg. Пожалуйста откройте консоль (Cmd + Option + I), остановите выполнение JS на странице (F8+cmd+\\) и свяжитесь с командой сообщений на вебе.")}a.d(t,{showDebugAlert:()=>r})},645523:(e,t,a)=>{"use strict";a.d(t,{CHANGE_VOICE_UI:()=>i,editMessageLocallyEvent:()=>s,transitionEvent:()=>o,resetPeer:()=>l,changePeer:()=>c,changeTab:()=>d,changeVoiceTranscriptUI:()=>u,failedMessage:()=>_,resendEvent:()=>g,compactCounterEvents:()=>m});var r=a(570655),n=a(663825),i="change_voice_ui";function s(e){return(0,r.__assign)((0,r.__assign)({},e),{type:n.EDIT_MESSAGE})}function o(e){return{type:n.TRANSITION,state:e}}function l(e,t){return void 0===e&&(e=!1),void 0===t&&(t=!1),{type:n.RESET_PEER,cancelSearch:e,removeActivePeer:t}}function c(e,t,a,r,i){return void 0===t&&(t=!1),void 0===a&&(a=!1),void 0===r&&(r=!1),void 0===i&&(i=""),{type:n.CHANGE_PEER,peerId:e,msgid:t,forward:a,cancelSearch:r,entryPoint:i}}function d(e){return{type:n.CHANGE_TAB,tab:e}}function u(){return{type:i}}function _(e,t,a){return{type:n.FAILED_MESSAGE,message:t,peerId:e,error:a}}function g(e,t){return{type:n.RESEND,message:t,peerId:e}}function m(e){var t=!1;return e.reduceRight((function(e,a){var r=a.type===n.UNREAD_COUNT,i=!t&&r;return r&&!i||e.unshift(a),i&&(t=!0),e}),[])}},820696:(e,t,a)=>{"use strict";a.d(t,{getFolderInlineMenuActionsData:()=>u,getFilteredConvoList:()=>_});var r=a(179288),n=a(527864),i=a(49031),s=a(786067),o=a(743707),l=a(459554),c=a(923876),d=a(712439);function u(e){var t,a,l,c,d,u,_;return(t={})[r.FolderAction.SHOW]={name:null!==(d=null===(a={},a[r.ConvoListFolder.BUSINESS_NOTIFY]=(0,s.getLang)("mail_folder_action_show_business_notify"),a[r.ConvoListFolder.ARCHIVE]=(0,s.getLang)("mail_folder_action_show_archive"),c=a)||void 0===c?void 0:c[""+e])&&void 0!==d?d:(0,s.getLang)("mail_folder_action_show_default"),icon:null!==(_=null===(l={},l[r.ConvoListFolder.BUSINESS_NOTIFY]=(0,i.getIcon20WorkOutline)().icon,l[r.ConvoListFolder.ARCHIVE]=(0,n.getIcon20ArchiveOutline)().icon,u=l)||void 0===u?void 0:u[""+e])&&void 0!==_?_:(0,o.getIcon20Add)().icon},t}function _(e,t,a){var r=(0,d.unpackStore)(e),n=(0,c.getFilterFnForConvoListFolder)(a);return t.reduce((function(e,t){var a=(0,l.getTab)(r,t);return a&&n(a)&&e.push(a.peerId),e}),[])}},653736:(e,t,a)=>{"use strict";a.d(t,{wrapHashAction:()=>s,wrapHashActionReversed:()=>o});var r=a(570655),n=a(459554),i=a(121074);function s(e){return function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var n=t[t.length-1];return e.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(t))).catch((function(a){if(a&&a.match&&a.match(/1001;/))return l(n,e,t);throw a}))}}function o(e){return function(t){for(var a=[],n=1;n<arguments.length;n++)a[n-1]=arguments[n];return e.apply(void 0,(0,r.__spreadArray)([t],(0,r.__read)(a))).catch((function(r){if(r&&r.match&&r.match(/1001;/))return l(t,e,[t].concat(a));throw r}))}}function l(e,t,a){return function(e){return e.resync_in_process?e.resync_in_process:Promise.resolve(!1)}(e).then((function(s){return s?t.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(a))):function(e){if(!e.renew_hashes){var t=e.last_hashes_update||0;if(Date.now()-t<1e4)return Promise.resolve();var a=Object.keys(e.tabs).filter((function(t){return(0,n.isFullyLoadedTab)(e,+t)}));e.renew_hashes=(0,i.loadHashes)(a,{},e).then((function(t){var n=(0,r.__read)(t,3),i=n[0],s=n[1],o=n[2];return a.forEach((function(t){var a=+t;e.tabs[a].hash=i[a]})),e.writeHash=s,e.manageTagsHash=o,delete e.renew_hashes,e.last_hashes_update=Date.now(),e}))}return e.renew_hashes}(e).then((function(){return t.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(a)))}))}))}},412827:(e,t,a)=>{"use strict";a.d(t,{parseMessage:()=>n});var r=a(375053);function n(e){return e&&Array.isArray(e)?(0,r.getMessageFromTuple)(e):e}},222131:(e,t,a)=>{"use strict";a.d(t,{makeUserFromUserConvo:()=>l,getUserInitials:()=>c,prepareContactName:()=>d});var r=a(495283),n=a(324816),i=a(898884),s=a(40906),o=a(695724);function l(e){return{id:e.peerId,link:e.href,name:e.name,first_name:"",short_name:"",first_name_gen:"",inv_name:"",kick_name:"",sex:e.sex,photo:e.photo||""}}function c(e){var t=(0,r.decodeHTMLEntities)(e),a=(0,n.emojiRegex)().exec(t);return a?0===a.index?(0,i.emojiReplace)(a[0]):t[0]:t.split(/\s/).reduce((function(e,t){return e+t.slice(0,1)}),"").slice(0,2)}function d(e){var t=(0,s.replaceEntities)(e);return(0,i.emojiToHTML)((0,o.clean)(t),!0)}},442347:(e,t,a)=>{"use strict";a.d(t,{replaceSpecialSymbols:()=>i,secondsToHuman:()=>s,formatDate:()=>o});var r=a(179288),n=a(786067);function i(e){return e.replace(/&lt;&lt;/g,"&laquo;").replace(/&gt;&gt;/g,"&raquo;").replace(/ \-\-/g," &mdash;").replace(/\-\- /g,"&mdash; ").replace(r.MENTION_RAW,"$1$4")}function s(e){var t=Math.floor(e/3600),a=Math.floor(e/60)-60*t,r=!1,n=!1;return[t,a,e-3600*t-60*a].reduce((function(e,t){if(0===t&&!n)return n=!0,e;var a=r&&t<10?"0"+t:t.toString();return r=!0,n=!0,e+(""!==e?":":"")+a}),"")}function o(e,t){return(0,n.langDate)(1e3*e,"{hour}:{minute} {am_pm}",1e3*t,[],!0)}},240367:(e,t,a)=>{"use strict";a.d(t,{setInfo:()=>n,sendMessageEvent:()=>i,getFriends:()=>s,getMembers:()=>o,search:()=>l,addFriend:()=>c,deleteFriend:()=>d,getMutual:()=>u,usersGet:()=>_,denyMessagesFromGroup:()=>g,allowMessagesFromGroup:()=>m,hideSuggestedContact:()=>p,archiveConversation:()=>h,unarchiveConversation:()=>f,recogniseAudioMessage:()=>v,markAsListened:()=>b,hideHelpHint:()=>C});var r=a(189798);function n(e,t){return(0,r.api)("account.setInfo",{name:e,value:t})}function i(e){return(0,r.api)("messages.sendMessageEvent",e)}function s(e){return(0,r.api)("donut.getFriends",e)}function o(e){return(0,r.api)("groups.getMembers",e)}function l(e){return(0,r.api)("users.search",e)}function c(e){return(0,r.api)("friends.add",e)}function d(e){return(0,r.api)("friends.delete",e)}function u(e){return(0,r.api)("friends.getMutual",e)}function _(e){return(0,r.api)("users.get",e)}function g(e){return(0,r.api)("messages.denyMessagesFromGroup",e)}function m(e){return(0,r.api)("messages.allowMessagesFromGroup",e)}function p(e){return(0,r.api)("messages.hideSuggestedContact",e)}function h(e){return(0,r.api)("messages.archiveConversation",e)}function f(e){return(0,r.api)("messages.unarchiveConversation",e)}function v(e,t){return(0,r.api)("messages.recogniseAudioMessage",{message_id:e,audio_message_id:t})}function b(e,t){return(0,r.api)("messages.markAsListened",{message_id:e,group_id:t})}function C(e){return(0,r.api)("account.hideHelpHint",{hint_id:e})}},309756:(e,t,a)=>{"use strict";a.d(t,{showNotification:()=>n});var r=a(695724);function n(e){var t=e.text,a=e.type,n=e.title,i=e.photo;window.Notifier&&window.Notifier.showEvent({text:(0,r.clean)(t),type:a,title:n,author_photo:i})}},827749:(e,t,a)=>{"use strict";a.d(t,{ConvoInviteEntryPoint:()=>r,TopMessengerTransition:()=>n,collectConvoInviteStats:()=>u,collectOnboardingFindFriendsShowStats:()=>_,collectOnboardingFindFriendsClickStats:()=>g,collectConversationSuggestionItemStats:()=>m,collectOpenMessageRequestStats:()=>p,collectChatCreateStats:()=>h,collectUIChangeStats:()=>f,collectTopMessengerTransitions:()=>v,collectVoiceStat:()=>b});var r,n,i=a(171516),s=a(940441),o=a(724702),l=a(676554),c=a(19331),d=a(746133);!function(e){e.DIALOG_ACTIONS="dialog_actions",e.PROFILE_SCREEN="profile_screen",e.CONTACT_SCREEN="contact_screen"}(r||(r={})),function(e){e.TO_FASTCHAT="open_top_messenger_to_fastchat",e.TO_MESSENGER_CHAT="open_top_messenger_to_messenger_chat",e.TO_MESSENGER="open_top_messenger_to_messenger"}(n||(n={}));var u=function(e,t){(0,i.saveStatlogEvents)({name:"convo_invite",value:e,keys:[t]})},_=function(e){s.customMetricsCollector.logEvent({experiment_id:1285,service:"messages",metric_name:"open_vk_service_chat",metric_value:3,unit_id:e,unit_type_id:1})},g=function(e){s.customMetricsCollector.logEvent({experiment_id:1285,service:"messages",metric_name:"push_find_friends_button",metric_value:3,unit_id:e,unit_type_id:1})},m=function(e,t,a){l.ContactRecommendationCollector.logEvent({event_type:a,track_code:e,position:t})},p=function(e){o.messagingActionItemStatCollector.logEvent({peer_id:e,action_type:"OPEN_MR"})},h=function(e,t,a){(0,c.partConfigEnabled)("me_web_log_create_chat")&&o.messagingActionItemStatCollector.logEvent({peer_id:e,action_type:"CREATE_CHAT",entry_point:t,group_id:a})},f=function(e){o.messagingActionItemStatCollector.logEvent({action_type:e?"GO_FROM_OLD_TO_NEW_INTERFACE":"GO_FROM_NEW_TO_OLD_INTERFACE"})},v=function(e,t){s.customMetricsCollector.logEvent({experiment_id:2142,unit_id:e,service:"messages",unit_type_id:1,metric_name:t,metric_value:1})},b=function(e,t,a,r,n,i){d.audioMessageStatCollector.logEvent({action_type:e,peer_id:t,cmid:a,audio_message_id:r,action_source:"msg_list_attach",playback_rate:"play"===e?100:void 0,transcription_show:void 0!==n?n?1:0:void 0,actor:i})}},419672:(e,t,a)=>{"use strict";a.d(t,{unpackHistory:()=>m,appendMessageToHistory:()=>p,ensureDomHasActions:()=>h,removeMessagesWithStack:()=>f,removeNewUnreadBarAndMerge:()=>v});var r=a(459554),n=a(315544),i=a(376473),s=a(826338),o=a(695724),l=a(289988),c=a(786067),d=a(982452),u=a(163612),_=a(917791),g=a(179288);function m(e){return"string"==typeof e?(0,n.se)("<div>"+e+"</div>"):e}function p(e,t,a,p,b){void 0===p&&(p=!0),void 0===b&&(b=!0);var C=(0,r.getTab)(e,t.peerId);if(C&&a){var E=m(a);if(!a||E.querySelector("._im_mess")||E.querySelector("._im_bar_date")||(E.innerHTML=""),C.skipped&&C.skipped>0)return E;var y=[];if(!t.local&&e.imQueue&&(y=e.imQueue(t.peerId,p)),y.length>0)f(y.reduce((function(e,t){var a=E.querySelector("._im_mess_rid"+t.rid);return a&&e.push(a),e}),[]),E);var T=(0,u.renderMessage)(e,t),I=(0,n.domLC)(E);I&&!I.classList.contains("_im_mess_stack")&&(I=(0,n.domClosestSibling)(I,"._im_mess_stack",-1));for(var A=(0,i.getLastMessage)(e,t.peerId,t.messageId);t.peerId===e.peer&&A&&!E.querySelector("._im_mess_"+A.messageId);)A=(0,i.getLastMessage)(e,t.peerId,A.messageId);var L=E.querySelector("._im_unread_bar_row"),S=A?(0,i.shiftDate)(e,A.date):0,k=(0,s.isChatPeer)(t.peerId)&&(0,r.isCasperChatTab)(C);if(!A||(0,i.isNewStack)(C,A,t,e,b)){var M="",N=!1;if(L&&(0,i.isOutbound)(t)&&v(e,E,t.peerId),1===C.unread&&!(0,i.isOutbound)(t)&&b&&(M+=(0,o.getTemplate)("im_mess_bar",{}),N=!0,v(e,E,t.peerId)),!(0,l.isToday)(new Date(S))&&!k){var w=new Date,P=N?"im-page--history-new-bar_hide _im_invisible_bar":"";M+=(0,o.getTemplate)("im_day_bar",{day:(0,c.getShortDate)(t.date,e.timeshift,!0,(0,c.getLang)("months_of","raw"),!0),date:t.date,day_class:w.getDate()+w.getMonth()+w.getFullYear()+" "+P})}if((0,i.isServiceMsg)(t))M+=(0,o.getTemplate)("im_service_row",{text:(0,u.renderServiceMsg)(e,t,C.peerId),type:"",date:t.date,from_id:"",message_id:t.messageId});else{var O=(0,u.getStackDataFromMessage)(e,t);M+=(0,o.getTemplate)("im_mess_stack",Object.assign(O,{messages:T}))}(0,d.toArray)((0,n.sech)(M)).forEach((function(e){return E&&E.appendChild(e)}))}else L&&e.peer===t.peerId&&!C.inplaceSearch&&(0,i.isOutbound)(t)&&v(e,E,t.peerId),I.querySelector("._im_stack_messages").appendChild((0,n.se)(T));var R=Date.now()-1e3*t.date>g.SENDING_ICON_TIMEOUT;return(0,i.isOutbound)(t)&&!R&&setTimeout((function(){var e=E.querySelector("._im_mess_"+t.messageId);e&&e.classList.contains(u.SENDING_CLASS)&&e.classList.add("im-mess_sending")}),g.SENDING_ICON_TIMEOUT),y=y.filter((function(e){return e.rid!==t.randomId})),h(E),(0,_.restoreQueuedMessagesInDom)(e,y,E)}}function h(e){for(var t=e.querySelectorAll("._im_mess_noa:not(._im_mess_callsnippet):not(._im_mess_srv)"),a=t.length;a--;)t[a].classList.contains("im-mess_fwd")||t[a].insertAdjacentHTML("afterbegin",(0,o.getTemplate)("sImHistoryRowActions")),t[a].classList.remove("_im_mess_noa")}function f(e,t){var a=e.filter((function(e){return!e.classList.contains("im-mess_srv")})).map((function(e){return e.parentElement}));return e.forEach((function(e){var t=e.parentNode;if(t)if(e.classList.contains("im-mess_srv")){var a=t.parentNode;a&&a.removeChild(t)}else t.removeChild(e)})),a.filter((function(e){return 0===(0,n.domChildren)(e).length})).map((function(e){return e?e.closest("._im_mess_stack"):void 0})).forEach((function(e){var t,a;(null===(t=(0,n.domPS)(e))||void 0===t?void 0:t.classList.contains("_im_bar_date"))&&(0,n.re)((0,n.domPS)(e)),(null===(a=(0,n.domPS)(e))||void 0===a?void 0:a.classList.contains("_im_unread_bar_row"))&&(0,n.re)((0,n.domPS)(e)),(0,n.re)(e)})),t}function v(e,t,a){var r=t.querySelector("._im_unread_bar_row");if(!r)return t;var s=(0,n.domClosestSibling)(r,"._im_mess_stack",-1),o=(0,n.domClosestSibling)(r,"._im_mess_stack"),l=s?Array.from(s.querySelectorAll("._im_mess")).pop():null,c=o?o.querySelector("._im_mess"):null;if((0,n.re)(r),function(e){var t=e.querySelector("._im_invisible_bar");t&&t.classList.remove("_im_invisible_bar","im-page--history-new-bar_hide")}(t),!c||!l)return t;var u=c.dataset.msgid,_=(0,i.getPreviousMessage)(e,a,u),g=(0,i.getMessage)(e,a,u);if(!_||!g||(0,i.isNewStack)(e.tabs[a],_,g,e))return t;var m=s.querySelector("._im_stack_messages"),p=o.querySelector("._im_stack_messages").children;return(0,d.toArray)(p).forEach((function(e){(0,n.re)(e),m.appendChild(e)})),(0,n.re)(o),t}},163612:(e,t,a)=>{"use strict";a.d(t,{SENDING_CLASS:()=>C,FAILED_CLASS:()=>E,renderMessage:()=>y,parseMessageText:()=>T,renderMessageMedia:()=>A,renderCallUserList:()=>S,getStackDataFromMessage:()=>k,renderServiceMsg:()=>M,getServiceLinkTemplate:()=>N});var r=a(570655),n=a(459554),i=a(376473),s=a(695724),o=a(826338),l=a(786067),c=a(722088),d=a(993421),u=a(266372),_=a(315544),g=a(442347),m=a(712439),p=a(606542),h=a(582744),f=a(659397),v=a(19331),b=a(179288),C="_im_mess_sending",E="_im_mess_failed";function y(e,t){var a=[],r=(0,n.getTab)(e,t.peerId),_=r&&(0,i.isUnread)(r,t),p=(0,i.isCallMessage)(t)||(0,i.isActiveGroupCallMessage)(t),h=r&&(0,n.getPinnedMessage)(r),f=(0,i.hasReply)(t)?(0,s.getTemplate)("im_message_media",{type:"reply",messageId:t.messageId,attaches:I("reply"),text:""}):"";p||a.push("_im_mess"),(0,i.isOutbound)(t)&&_&&!p&&a.push("im-mess_unread _im_mess_unread"),(0,i.isOutbound)(t)&&!p&&a.push("im-mess_out"),(0,i.wasEdited)(t)&&a.push("im-mess_was_edited"),(0,i.canMessageBeEdited)(e,t)&&a.push("im-mess_editable"),(0,i.isImportant)(t)&&a.push("im-mess_fav"),(e.selectedMessages||[]).includes(t.messageId)&&a.push("im-mess_selected"),h&&h.messageId===t.messageId&&a.push("_im_mess_pinned");var v=Date.now()-1e3*t.date>b.SENDING_ICON_TIMEOUT;t.local&&v&&a.push("im-mess_sending"),t.local&&a.push(""+C),t.local&&(0,i.wasEdited)(t)&&!_&&a.push("im-mess_unread im-mess_nobg"),t.failed&&a.push("im-mess_failed "+E),(0,i.isGift)(t)&&a.push("im-mess_gift"),p&&a.push("_im_mess_callsnippet"),(0,i.isCasperMessage)(t)&&a.push("im-mess_casper");var y=A(t).concat(function(e){if(e.kludges.keyboard&&e.kludges.keyboard.inline){var t=e.kludges.keyboard.buttons,a=0;return[].concat((0,s.getTemplate)("sImMessageKeyboard",{content:t.map((function(e){return(0,s.getTemplate)("sImMessageKeyboardRow",{content:e.map((function(e){return(0,s.getTemplate)("sImMessageKeyboardButton",{label:(0,u.getButtonLabel)(e),appearance:(0,u.getButtonAppearance)(e),type:e.action.type,modifier:e.action.type.replace("_","-"),attributes:(0,u.getAttributesFromActionObject)(e.action,a++),tagName:e.action.type===u.BUTTON_TYPE_OPEN_LINK?"a":"button"})})).join("")})})).join("")}))}return[]}(t)),L=function(e,t){var a="",r=(0,m.unpackStore)(e).sourceEnabled&&t.kludges&&t.kludges.from_widget&&t.kludges.ref_source;(0,i.wasEdited)(t)&&(a+=(0,s.getTemplate)("sImLblWasEdited",{update_time:t.update_time}));if((0,d.isCommunityInterface)(e)&&r){var n=t.kludges.ref_source,o=void 0;try{(o=JSON.parse((0,s.unclean)(n))).link&&o.info&&(o.link=(0,c.replaceHyperLinks)((0,s.clean)(o.link),(function(e){return(0,c.linksReplacer)(!1,e)})),o=(0,s.clean)((0,l.langStr)((0,l.getLang)("mail_source_info"),"link",o.link,"info",(0,s.clean)(o.info))),a+=(0,s.getTemplate)("sImLblWasSourceInfo",{source:o}))}catch(e){}}return a}(e,t),k=f+T(e,t.text,t.kludges,t.peerId);t.subject&&"..."!==t.subject.trim()&&!(0,o.isChatPeer)(t.peerId)&&(k=(0,s.getTemplate)("im_topic",{topic:t.subject})+k);var M=y.length>0?(0,s.getTemplate)("im_message_media",{type:"media",messageId:t.messageId,attaches:y.join(""),text:""}):"",N=t.kludges.has_template?function(e){return'<div class="bot-carousel-placeholder _im_bot_carousel_'+e.messageId+'"></div>'}(t):"";return(0,i.isGift)(t)||(M=k+N+M),(0,i.isCallMessage)(t)&&(M+=function(e,t,a){var r=e.viewer_id,n=t.attaches[0],i=n.initiatorId,o=n.state,c=r===i,d=Boolean(t.kludges.attach1_call_video),u=t.kludges.attach1_call_participants&&JSON.parse(t.kludges.attach1_call_participants)||{},_="group_call"===t.kludges.attach1_kind,m={title:"",description:"",modifier:"",button:"",user_list:""},p=d?(0,l.getLang)("mail_call_snippet_outgoing_video"):(0,l.getLang)("mail_call_snippet_outgoing"),h=d?(0,l.getLang)("mail_call_snippet_incoming_video"):(0,l.getLang)("mail_call_snippet_incoming");switch(o){case"reached":var f=a?"":(0,g.secondsToHuman)(n.duration);m.title=c?p:h,m.description=(0,l.getLang)("mail_call_snippet_finished")+" · "+f;break;case"canceled_by_initiator":c?(m.title=p,m.description=(0,l.getLang)("mail_call_snippet_canceled")):(m.title=h,m.description=(0,l.getLang)("mail_call_snippet_missed"));break;case"canceled_by_receiver":if(c){if(a)return(0,l.getLang)("mail_call_declined");m.title=p,m.description=(0,l.getLang)("mail_call_snippet_declined")}else m.title=h,m.description=(0,l.getLang)("mail_call_snippet_canceled");break;default:m.title=(0,l.getLang)("mail_added_call")}_&&(m.title=(0,l.getLang)("mail_call_snippet_group"));var v=Object.keys(u).map(Number);return m.user_list=S(e,v),m.classes="im-mess--call-snippet CallSnippet--interactive _im-call-snippet",m.attributes='data-participants="'+v.join(",")+'"',(0,s.getTemplate)("sImCallSnippet",m)}(e,t)),M+=L,(0,s.getTemplate)("im_msg_row",{msg_id:t.messageId,cmid:t.chat_local_id,from_id:t.peerId,aria_hidden:t.local&&!t.failed?"true":"false",ts:t.date,marker_params:t.failed?'aria-label="'+(0,l.getLang)("mail_send_message_error")+'" role="link"':"",unread_params:_?'aria-label="'+(0,l.getLang)("mail_unread_message")+'"':"",cls:a.join(" ")}).replace("%text%",(function(){return M}))}function T(e,t,a,r){var n=Math.round(1e9*Math.random()).toString(16),i={},s=0,o=(0,c.replaceHyperLinks)(t||"",(function(e){return(0,c.linksReplacer)(!1,e)}));return o=o.replace(/(<a.+?<\/a>)/gi,(function(e){var t="!link_"+s+"_"+n+"!";return i[t]=e,s++,t})),o=(0,c.replaceMentions)(o),e.isMassMentionsMessageAllowed&&(o=(0,c.replaceMassMentions)(o)),o=(0,c.replaceEmailLinks)(o),o=(0,c.replaceHashtags)(o,(function(t){var a=(0,d.getGroupId)(e);return'<a href="/'+(a?"gim"+a:"im")+"?sel="+(r||(0,d.getPeer)(e))+"&st="+encodeURIComponent(t)+'">'+t+"</a>"})),Object.keys(i).forEach((function(e){o=o.replace(e,(function(){return i[e]}))})),a.emoji&&(o=window.Emoji.emojiToHTML(o,!0)),o}function I(e){return(0,s.getTemplate)("im_preloader",{preloader:(0,_.rs)(window.vk.pr_tpl,{id:""}),cls:"im-preloader_attach im-preloader_visible im-preloader_"+e})}function A(e){return e.attaches.reduce((function(t,a){return!(0,i.hasReply)(e)||"mail"!==a.type&&"reply"!==a.type?("call"===a.type||("sticker"===a.type?e.messageId?t.push(L(a.id,a.productId,a.kind,e.messageId)):t.push(L(a.id,a.productId)):t.push(I(a.type))),t):t}),[])}function L(e,t,a,r){var n=window.devicePixelRatio>=2?"256":"128",i="animation"===a,s="im_gift";i&&(s+=" sticker_img");var o='<img height="128" class="'+s+'" src="'+window.Stickers.getStickerUrl(Number(e),n)+'"/>';if(i){var l="animatedSticker"+r;o='<div id="'+l+'" data-loop-count=3 data-animation-path="'+("/stickers.php?act=proxy_animation&product_id="+t+"&sticker_id="+e)+'" onmouseenter="StickersAnimation.loadAndPlaySticker(this);"\n     data-uniq-id="'+r+'" data-sticker-id="'+Number(e)+'" class="sticker_animation sticker_animation_128 im_gift">'+o+"</div>";var c=!1;window.browser.msie?"number"==typeof r&&(0^r)===r&&(c=!0):c=Number.isInteger(r),c&&window.StickersSettings.getAutoplay()&&window.StickersAnimation&&window.StickersAnimation.loadAndPlayStickerWithTimer(l,10)}return t&&(o='<a onmouseover="return Emoji.stickerOver('+Number(e)+', this);"\n        onclick="return Emoji.clickSticker('+Number(t)+', this, event);">'+o+"</a>"),o='<div class="im_sticker_row">'+o+"</div>"}function S(e,t){if(!t.length)return"";var a=t.slice(0,3).reduce((function(t,a){var r=(0,p.oCacheGet)(e,a);return r&&(t+=(0,s.getTemplate)("sImCallUser",{url:r.photo,name:r.name})),t}),"");return(0,s.getTemplate)("sImCallUsers",{users:a})}function k(e,t){var a=(0,m.unpackStore)(e),c=t.peerId,u=t.messageId,_=(0,n.getTab)(e,c),v=(0,i.getMessageUserId)(a,t),b=(0,i.getMessageAdminId)(e,t),C=(0,p.oCacheGet)(a,b?-a.gid:v),E={name:(null==C?void 0:C.name)||(null==_?void 0:_.name)||"",first_name:(null==C?void 0:C.first_name)||(null==_?void 0:_.name)||"",href:(null==C?void 0:C.link)||(null==_?void 0:_.href)||"",sex:(null==C?void 0:C.sex)||(null==_?void 0:_.sex)||0,photo:(null==C?void 0:C.photo)||(null==_?void 0:_.photo)||"",image_status:(null==C?void 0:C.image_status)||""},y=(0,o.isChatPeer)(c)?E.name:E.first_name,T=E.href,I=(0,o.isChatPeer)(c)&&E.image_status?E.image_status:"",A=(0,s.getTemplate)("im_mess_stack_name",{name:y+I,link:T,class:(0,i.isMoney)(t)?" im-mess-stack--lnk-money-transfer":""});if((0,i.isGift)(t)&&(A+=(0,s.getTemplate)("sImGiftLabel",{content:(0,l.langSex)(E.sex||0,(0,l.getLang)("mail_gift_message_sent","raw"))})),(0,i.isMoney)(t)){var L=(0,i.isMoneyRequest)(t)?(0,l.getLang)("mail_money_request_message_sent","raw"):(0,l.getLang)("mail_money_tranfer_message_sent","raw");A+=(0,s.getTemplate)("sImMoneyTransferLabel",{content:(0,l.langSex)(E.sex||0,L)})}var S=function(e,t){var a=(0,m.unpackStore)(e),c=t.peerId,u=t.messageId,_=(0,n.getTab)(a,c),p=_&&(0,o.isChatPeer)(c)&&(0,n.isCasperChatTab)(_),v=(0,i.getMessageAdminId)(e,t),b=(0,d.isCommunityInterface)(e)?"/gim"+a.gid:"/im",C=p?"":(0,s.getTemplate)("im_stack_date",{date:(0,g.formatDate)(t.date,a.timeshift),link:b+"?sel="+c+"&msgid="+u});if(v&&a.admins[v]){var E=a.admins[v],y=v===a.viewer_id?(0,l.getLang)("mail_by_you"):E[0];C+=" "+(0,s.getTemplate)("im_admin_link",{name:y,href:E[1]})}return C+function(e,t){if(!(0,i.isCasperMessage)(t))return"";var a=(0,n.getTab)(e,t.peerId),o=(0,r.__read)(h.casperMessagesStore.getTimings(t.chat_local_id),3),l=o[0],c=o[1],d=o[2],u=Math.max(l+c-d,0);return(0,s.getTemplate)("sImBomb",{classnames:(0,f.classNames)({"im-mess-stack--bomb_hidden":a&&(0,n.isCasperChatTab)(a),"im-mess-stack--bomb_expiring":u<=h.EXPIRING_TIME,"im-mess-stack--bomb_expiring-soon":u<=h.EXPIRING_SOON_TIME})})}(a,t)}(e,t);return{photo:E.photo,href:T,cls:"",date_attr:"",link:"/im?sel="+c+"&msgid="+u,name:(0,s.stripHTML)(A),stack_name:A,peerId:v,messageMeta:S,admin:b}}function M(e,t,a,r){void 0===r&&(r=!0);var n=(0,m.unpackStore)(e),c=t.kludges,d=c.source_act,u=Number(c.source_mid),_=Number((0,o.isChatPeer)(a)?c.from:(0,i.isOutbound)(t)?n.id:t.userId),h=_===u,f=(0,p.oCacheGet)(e,_),b="raw",C=(0,v.partConfigEnabled)("messenger_web_themes_easter_egg")&&("conversation_style_update"===d||"conversation_style_update_action"===d)&&c.source_style&&(n.conversationStylesEasterEggs===c.source_style||"all"===n.conversationStylesEasterEggs),E="";switch(d){case"chat_create":E="mail_im_chat_created";break;case"chat_title_update":E=c.source_is_channel?"mail_im_title_updated_channel":"mail_im_title_updated_dot";break;case"chat_invite_user":E=h?"mail_im_returned_to_chat":"mail_im_invited";break;case"chat_kick_user":E=h?"mail_im_left":"mail_im_kicked_from_chat";break;case"chat_photo_update":E="mail_im_photo_set";break;case"chat_photo_remove":E=c.source_is_channel?"mail_im_photo_removed_channel":"mail_im_photo_removed";break;case"chat_pin_message":E=c.source_message?"mail_im_pin_message":"mail_im_pin_message_empty2";break;case"chat_unpin_message":E=c.source_message?"mail_im_unpin_message":"mail_im_unpin_message_empty2";break;case"chat_invite_user_by_link":E="mail_im_invite_by_link";break;case"chat_invite_user_by_message_request":E="mail_im_invite_by_message_request";break;case"chat_screenshot":E=n.id===u?"mail_im_chat_own_screenshot":"mail_im_chat_screenshot";break;case"chat_group_call_started":E="mail_im_start_group_call";break;case"chat_invite_user_by_call":E="mail_im_invited_to_call";break;case"chat_invite_user_by_call_join_link":E="mail_im_invite_by_call_link";break;case"sent_message_requests_count":E="mail_creation_count_mr_service_msg",b=Number(c.count_mr);break;case"accepted_message_request":E=(null==f?void 0:f.contact_name)?"mail_im_accepted_message_request":"mail_im_accepted_message_request_no_name";break;case"chat_kick_user_call_block":E="mail_im_kick_user_call_block";break;case"chat_kick_don":E="mail_im_chat_kick_don";break;case"conversation_style_update":case"conversation_style_update_action":E=c.source_style?C?"mail_im_change_chat_theme_easter_egg":"mail_im_change_chat_theme":"mail_im_reset_chat_theme";break;default:return(0,l.getLang)("mail_no_support")}var y=(0,p.oCacheGet)(e,u),T=y?function(e,t,a){return"chat_invite_user_by_message_request"===e?a:t}(d,(null==f?void 0:f.sex)||0,y.sex):null==f?void 0:f.sex;if(E=(E=(0,l.langSex)(T,(0,l.getLang)(E,b))).replace("{from}",N((null==f?void 0:f.link)||"",f?function(e,t){return"chat_invite_user_by_message_request"===t?e.inv_name:e.name}(f,d):"",r)),E=E.replace("{contact}",(null==f?void 0:f.contact_name)||""),u&&!h){var I=c.source_email,A=I?N("/im?email="+encodeURIComponent(I),"email",r):N((null==y?void 0:y.link)||"",y?function(e,t){if("chat_invite_user_by_message_request"===t)return e.name;return"chat_kick_user"===t?e.inv_name:e.kick_name}(y,d):"",r);E=E.replace("{user}",A)}if(c.source_text&&c.source_text.length>0){var L=c.source_old_text?'«<b class="im_srv_lnk">'+c.source_old_text+"</b>» &rarr; ":"";E=E.replace("{title}",L+'«<b class="im_srv_lnk">'+c.source_text+"</b>»")}if("chat_pin_message"===d||"chat_unpin_message"===d)if(c.source_message){var S=N("",(0,g.replaceSpecialSymbols)(window.Emoji.emojiToHTML((0,s.stripHTML)(c.source_message.replace(/<br\s?\/?>/gi," ")),!0)),!1,"im_srv_mess_link");E=E.replace("{msg}",S)}else E=E.replace(/{link}(.+){\/link}/i,(function(e,t){return N("",t,!1,"im_srv_mess_link")}));if("conversation_style_update"===d||"conversation_style_update_action"===d){if(c.source_style){var k=C?(0,l.getLang)("mail_conversation_style_easter_egg"):(0,l.getLang)("mail_conversation_style_"+c.source_style);E=E.replace("{style}",k)}var M=n.conversationStylesLongreadLink;E=E.replace(/{link}(.+){\/link}/i,(function(e,t){return N(M,t,!0)}))}return E}function N(e,t,a,r){return void 0===r&&(r=""),a?'<a class="im_srv_lnk '+r+'" target="_blank" rel="noopener" href="'+e+'">'+t+"</a>":'<span class="'+r+'">'+t+"</span>"}},352111:(e,t,a)=>{"use strict";a.d(t,{updateUnreadCounter:()=>i});var r=a(712439),n=a(993421);function i(e){var t=(0,n.getGroupId)(e),a=(0,n.getUnreadCount)(e),i=(0,n.getHeaderUnreadCount)(e),s=t?"mgid"+t:"msg",o=(0,r.unpackStore)(e);window.handlePageCount(s,a,"","",o.unread_counters.countNotMuted>0,i)}}}]);try{stManager.done("dist/6641751fdb6217e2d8bf055581cb60be.ff17cc9fc64a82d5e4d8.js")}catch(e){}